From df4dc3492cf9cf8613eb13f8fedf78224fa70a37 Mon Sep 17 00:00:00 2001 From: Ross Lawley Date: Thu, 25 Apr 2013 11:41:01 +0000 Subject: [PATCH] Upgrade changelog, docs and django/auth.py --- AUTHORS | 1 - docs/changelog.rst | 1 + docs/upgrade.rst | 6 +++--- mongoengine/django/auth.py | 5 ++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/AUTHORS b/AUTHORS index e388a04a..44e19bf6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -157,4 +157,3 @@ that much better: * Kenneth Falck * Lukasz Balcerzak * Nicolas Cortot - diff --git a/docs/changelog.rst b/docs/changelog.rst index 6c19933e..bd3821fe 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,6 +4,7 @@ Changelog Changes in 0.8.X ================ +- Added Custom User Model for Django 1.5 (#285) - Cascading saves now default to off (#291) - ReferenceField now store ObjectId's by default rather than DBRef (#290) - Added ImageField support for inline replacements (#86) diff --git a/docs/upgrade.rst b/docs/upgrade.rst index 86d9f9d7..738a949b 100644 --- a/docs/upgrade.rst +++ b/docs/upgrade.rst @@ -12,8 +12,8 @@ FutureWarnings to help get you ready for the change, but that hasn't been possible for the whole of the release. .. warning:: Breaking changes - test upgrading on a test system before putting -live. There maybe multiple manual steps in migrating and these are best honed -on a staging / test system. + live. There maybe multiple manual steps in migrating and these are best honed + on a staging / test system. Data Model ========== @@ -90,7 +90,7 @@ ReferenceField -------------- ReferenceFields now store ObjectId's by default - this is more efficient than -DBRefs as we already know what Document types they reference. +DBRefs as we already know what Document types they reference:: # Old code class Animal(Document): diff --git a/mongoengine/django/auth.py b/mongoengine/django/auth.py index 8fcbca97..cff4b743 100644 --- a/mongoengine/django/auth.py +++ b/mongoengine/django/auth.py @@ -108,7 +108,7 @@ class Permission(Document): created for each Django model. """ name = StringField(max_length=50, verbose_name=_('username')) - content_type = ReferenceField(ContentType, dbref=True) + content_type = ReferenceField(ContentType) codename = StringField(max_length=100, verbose_name=_('codename')) # FIXME: don't access field of the other class # unique_with=['content_type__app_label', 'content_type__model']) @@ -149,8 +149,7 @@ class Group(Document): e-mail messages. """ name = StringField(max_length=80, unique=True, verbose_name=_('name')) - # permissions = models.ManyToManyField(Permission, verbose_name=_('permissions'), blank=True) - permissions = ListField(ReferenceField(Permission, verbose_name=_('permissions'), required=False, dbref=True)) + permissions = ListField(ReferenceField(Permission, verbose_name=_('permissions'), required=False)) class Meta: verbose_name = _('group')