From 66279bd90f57c964e1d4aa1c3356cd2320847735 Mon Sep 17 00:00:00 2001 From: Ross Lawley Date: Fri, 17 Aug 2012 11:58:57 +0100 Subject: [PATCH] Post refactor cleanups (ref: meta cleanups) --- docs/changelog.rst | 4 +--- mongoengine/document.py | 1 - tests/test_document.py | 14 +++++++------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 3bca6a17..070083e7 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,9 +4,7 @@ Changelog Changes in 0.7.X ================= -- Embedded Documents dont care about inheritance - - +- Embedded Documents no longer handle meta definitions - Use weakref proxies in base lists / dicts (MongoEngine/mongoengine#74) - Improved queryset filtering (hmarr/mongoengine#554) - Fixed Dynamic Documents and Embedded Documents (hmarr/mongoengine#561) diff --git a/mongoengine/document.py b/mongoengine/document.py index f6b0b511..23f3a23b 100644 --- a/mongoengine/document.py +++ b/mongoengine/document.py @@ -394,7 +394,6 @@ class DynamicDocument(Document): __metaclass__ = TopLevelDocumentMetaclass _dynamic = True - meta = {'abstract': True} def __delattr__(self, *args, **kwargs): """Deletes the attribute by setting to None and allowing _delta to unset diff --git a/tests/test_document.py b/tests/test_document.py index da329ca5..d4b2673c 100644 --- a/tests/test_document.py +++ b/tests/test_document.py @@ -2665,14 +2665,14 @@ class DocumentTest(unittest.TestCase): complex fields. """ - class BlogPost2(Document): + class BlogPost(Document): content = StringField() authors = ListField(ReferenceField(self.Person, reverse_delete_rule=CASCADE)) reviewers = ListField(ReferenceField(self.Person, reverse_delete_rule=NULLIFY)) self.Person.drop_collection() - BlogPost2.drop_collection() + BlogPost.drop_collection() author = self.Person(name='Test User') author.save() @@ -2680,19 +2680,19 @@ class DocumentTest(unittest.TestCase): reviewer = self.Person(name='Re Viewer') reviewer.save() - post = BlogPost2(content='Watched some TV') + post = BlogPost(content='Watched some TV') post.authors = [author] post.reviewers = [reviewer] post.save() - # Deleting the reviewer should have no effect on the BlogPost2 + # Deleting the reviewer should have no effect on the BlogPost reviewer.delete() - self.assertEqual(len(BlogPost2.objects), 1) - self.assertEqual(BlogPost2.objects.get().reviewers, []) + self.assertEqual(len(BlogPost.objects), 1) + self.assertEqual(BlogPost.objects.get().reviewers, []) # Delete the Person, which should lead to deletion of the BlogPost, too author.delete() - self.assertEqual(len(BlogPost2.objects), 0) + self.assertEqual(len(BlogPost.objects), 0) def test_two_way_reverse_delete_rule(self): """Ensure that Bi-Directional relationships work with