From d133913c3dd561e3b0a0002489cad4be9973637f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alice=20Bevan=E2=80=93McGregor?= Date: Tue, 13 Oct 2015 21:59:29 -0400 Subject: [PATCH] Remove now superfluous special cases. Removes `verbose_name`, `help_text`, and `custom_data`. All three are covered by the one metadata assignment and will continue working as expected. --- mongoengine/base/fields.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/mongoengine/base/fields.py b/mongoengine/base/fields.py index d92e9b3a..3427a094 100644 --- a/mongoengine/base/fields.py +++ b/mongoengine/base/fields.py @@ -41,8 +41,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, choices=None, verbose_name=None, - help_text=None, null=False, sparse=False, custom_data=None + validation=None, choices=None, null=False, sparse=False, **kwargs): """ :param db_field: The database field to store this field in @@ -61,16 +60,10 @@ class BaseField(object): field. Generally this is deprecated in favour of the `FIELD.validate` method :param choices: (optional) The valid choices - :param verbose_name: (optional) The verbose name for the field. - Designed to be human readable and is often used when generating - model forms from the document model. - :param help_text: (optional) The help text for this field and is often - used when generating model forms from the document model. :param null: (optional) Is the field value can be null. If no and there is a default value then the default value is set :param sparse: (optional) `sparse=True` combined with `unique=True` and `required=False` means that uniqueness won't be enforced for `None` values - :param custom_data: (optional) Custom metadata for this field. :param **kwargs: (optional) Arbitrary indirection-free metadata for this field. """ self.db_field = (db_field or name) if not primary_key else '_id' @@ -85,12 +78,9 @@ class BaseField(object): self.primary_key = primary_key self.validation = validation self.choices = choices - self.verbose_name = verbose_name - self.help_text = help_text self.null = null self.sparse = sparse self._owner_document = None - self.custom_data = custom_data conflicts = set(dir(self)).intersect(kwargs) if conflicts: