### Navigation

- index
- modules |
- next |
- previous |
- FeinCMS 1.7.4 documentation »

# Contrib

## Model and form fields

class `feincms.contrib.fields.``JSONField`(verbose_name=None, name=None, primary_key=False, max_length=None, unique=False, blank=False, null=False, db_index=False, rel=None, default=<class django.db.models.fields.NOT_PROVIDED at 0xae321dc>, editable=True, serialize=True, unique_for_date=None, unique_for_month=None, unique_for_year=None, choices=None, help_text=u'', db_column=None, db_tablespace=None, auto_created=False, validators=, []error_messages=None)

  TextField which transparently serializes/unserializes JSON objects

  See: http://www.djangosnippets.org/snippets/1478/

  `get_prep_value`(value)

    Convert our JSON object to a string before we save

  `to_python`(value)

    Convert our string value to JSON after we load it from the DB

  `value_to_string`(obj)

    Extract our value from the passed object and return it in string form

class `feincms.contrib.richtext.``RichTextField`(verbose_name=None, name=None, primary_key=False, max_length=None, unique=False, blank=False, null=False, db_index=False, rel=None, default=<class django.db.models.fields.NOT_PROVIDED at 0xae321dc>, editable=True, serialize=True, unique_for_date=None, unique_for_month=None, unique_for_year=None, choices=None, help_text=u'', db_column=None, db_tablespace=None, auto_created=False, validators=, []error_messages=None)

  Drop-in replacement for Django’s `models.TextField` which allows editing rich text instead of plain text in the item editor.

## Tagging

`feincms.contrib.tagging.``pre_save_handler`(sender, instance, **kwargs)

  Intercept attempts to save and sort the tag field alphabetically, so we won’t have different permutations in the filter list.

`feincms.contrib.tagging.``tag_model`(cls, admin_cls=None, field_name='tags', sort_tags=False, select_field=False, auto_add_admin_field=True)

  tag_model accepts a number of named parameters:

  admin_cls If set to a subclass of ModelAdmin, will insert the tag
    field into the list_display and list_filter fields.
  field_name Defaults to “tags”, can be used to name your tag field
    differently.
  sort_tags Boolean, defaults to False. If set to True, a pre_save
    handler will be inserted to sort the tag field alphabetically. This is useful in case you want a canonical representation for a tag collection, as when you’re presenting a list of tag combinations (e.g. in an admin filter list).
  select_field If True, show a multi select instead of the standard
    CharField for tag entry.
  auto_add_admin_field If True, attempts to add the tag field to the admin
    class.

### Navigation

- index
- modules |
- next |
- previous |
- FeinCMS 1.7.4 documentation »