diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2010-08-09 21:16:59 +0000 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2010-08-09 21:16:59 +0000 |
| commit | c7bd48cb9f645e5ff07d1e68b86130e3bb2b043f (patch) | |
| tree | a0459672ce695501236fa89879615a2896b42637 /tests/regressiontests/mongodb/models.py | |
| parent | 9b263c61f805947a06473fd5ca170e8b970aae32 (diff) | |
[soc2010/query-refactor] Improved the ListField implementation, and added an EmbeddedModelField.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/query-refactor@13564 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/mongodb/models.py')
| -rw-r--r-- | tests/regressiontests/mongodb/models.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/regressiontests/mongodb/models.py b/tests/regressiontests/mongodb/models.py index f0d950dcbb..9b7e25108e 100644 --- a/tests/regressiontests/mongodb/models.py +++ b/tests/regressiontests/mongodb/models.py @@ -31,3 +31,23 @@ class Post(models.Model): magic_numbers = models.ListField( models.IntegerField() ) + + +class Revision(models.Model): + number = models.IntegerField() + content = models.TextField() + + +class AuthenticatedRevision(Revision): + # This is a really stupid way to add optional authentication, but it serves + # its purpose. + author = models.CharField(max_length=100) + + +class WikiPage(models.Model): + id = models.NativeAutoField(primary_key=True) + title = models.CharField(max_length=255) + + revisions = models.ListField( + models.EmbeddedModel(Revision) + ) |
