Don't check for DO_NOTHING in the delete rule registration method.

It is already checked before it is invoked.  This saves the ugly import
of DO_NOTHING inside document.py.
This commit is contained in:
Vincent Driessen
2010-12-14 02:01:25 -08:00
parent f30fd71c5e
commit 620f4a222e
2 changed files with 3 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
from base import (DocumentMetaclass, TopLevelDocumentMetaclass, BaseDocument,
ValidationError)
from queryset import OperationError, DO_NOTHING
from queryset import OperationError
from connection import _get_db
import pymongo
@@ -105,9 +105,6 @@ class Document(BaseDocument):
"""This method registers the delete rules to apply when removing this
object.
"""
if rule == DO_NOTHING:
return
cls._meta['delete_rules'][(document_cls, field_name)] = rule