summaryrefslogtreecommitdiff
path: root/tests/queryset_pickle/models.py
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2013-05-21 12:57:24 +0300
committerAnssi Kääriäinen <akaariai@gmail.com>2013-06-14 17:05:54 +0300
commit5459795ef224c5c81461c06a95d38390ee91f014 (patch)
tree334b19f09bddeb246405d74dd697abd384c6b194 /tests/queryset_pickle/models.py
parent855d1305c54dbcd3a7fed3f7b10ff63f1bac88ba (diff)
downloaddjango-5459795ef224c5c81461c06a95d38390ee91f014.tar.gz
Fixed #20289 -- pickling of dynamic models
Diffstat (limited to 'tests/queryset_pickle/models.py')
-rw-r--r--tests/queryset_pickle/models.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/queryset_pickle/models.py b/tests/queryset_pickle/models.py
index 4bcfcfbf04..3a8973505c 100644
--- a/tests/queryset_pickle/models.py
+++ b/tests/queryset_pickle/models.py
@@ -36,3 +36,13 @@ class Happening(models.Model):
number2 = models.IntegerField(blank=True, default=Numbers.get_static_number)
number3 = models.IntegerField(blank=True, default=Numbers.get_class_number)
number4 = models.IntegerField(blank=True, default=nn.get_member_number)
+
+class Container(object):
+ # To test pickling we need a class that isn't defined on module, but
+ # is still available from app-cache. So, the Container class moves
+ # SomeModel outside of module level
+ class SomeModel(models.Model):
+ somefield = models.IntegerField()
+
+class M2MModel(models.Model):
+ groups = models.ManyToManyField(Group)