Skip to content
Browse files

Removed create_default since it can be achieved with the `default` ar…

…gument (like default=MyEmbeddedDocument since default takes callables too).
  • Loading branch information...
1 parent 416fcba commit 3c7e8be2e73d7b0d809603049faea5eaaffa1ac2 @flosch flosch committed Apr 17, 2010
Showing with 1 addition and 6 deletions.
  1. +1 −6 mongoengine/base.py
View
7 mongoengine/base.py
@@ -25,7 +25,7 @@ class BaseField(object):
def __init__(self, db_field=None, name=None, required=False, default=None,
unique=False, unique_with=None, primary_key=False, validation=None,
- create_default=False, choices=None):
+ choices=None):
self.db_field = (db_field or name) if not primary_key else '_id'
if name:
import warnings
@@ -38,7 +38,6 @@ def __init__(self, db_field=None, name=None, required=False, default=None,
self.unique_with = unique_with
self.primary_key = primary_key
self.validation = validation
- self.create_default = create_default
self.choices = choices
def __get__(self, instance, owner):
@@ -56,10 +55,6 @@ def __get__(self, instance, owner):
# Allow callable default values
if callable(value):
value = value()
-
- # Check whether we should auto-create a default document
- if self.create_default and hasattr(self, 'document'):
- value = self.document()
return value
def __set__(self, instance, value):

0 comments on commit 3c7e8be

Please sign in to comment.
Something went wrong with that request. Please try again.