X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/943e8bc4af0c11b0ace3811199e3b0844c4c3fbc..3d786c6d8c1bd3685ac328c7f4b811c13ea60e1a:/philo/models/fields/__init__.py?ds=sidebyside diff --git a/philo/models/fields/__init__.py b/philo/models/fields/__init__.py index eca3a12..efd315f 100644 --- a/philo/models/fields/__init__.py +++ b/philo/models/fields/__init__.py @@ -12,6 +12,7 @@ from philo.validators import TemplateValidator, json_validator class TemplateField(models.TextField): + """A :class:`TextField` which is validated with a :class:`.TemplateValidator`. ``allow``, ``disallow``, and ``secure`` will be passed into the validator's construction.""" def __init__(self, allow=None, disallow=None, secure=True, *args, **kwargs): super(TemplateField, self).__init__(*args, **kwargs) self.validators.append(TemplateValidator(allow, disallow, secure)) @@ -41,6 +42,7 @@ class JSONDescriptor(object): class JSONField(models.TextField): + """A :class:`TextField` which stores its value on the model instance as a python object and stores its value in the database as JSON. Validated with :func:`.json_validator`.""" default_validators = [json_validator] def get_attname(self): @@ -69,6 +71,7 @@ class JSONField(models.TextField): class SlugMultipleChoiceField(models.Field): + """Stores a selection of multiple items with unique slugs in the form of a comma-separated list.""" __metaclass__ = models.SubfieldBase description = _("Comma-separated slug field")