class documentation

class ModelMultipleChoiceField(ModelChoiceField): (source)

View In Hierarchy

A MultipleChoiceField whose choices are a model QuerySet.

Method __init__ Undocumented
Method clean Validate the given value and return its "cleaned" value as an appropriate Python object. Raise ValidationError for any errors.
Method has_changed Return True if data differs from initial.
Method prepare_value Undocumented
Method to_python Return a string.
Class Variable default_error_messages Undocumented
Method _check_values Given a list of possible PK values, return a QuerySet of the corresponding objects. Raise a ValidationError if a given value is invalid (not a valid PK, not in the queryset, etc.)

Inherited from ModelChoiceField:

Method __deepcopy__ Undocumented
Method get_limit_choices_to Return ``limit_choices_to`` for this form field.
Method label_from_instance Convert objects into strings and generate the labels for the choices presented by this object. Subclasses can override this method to customize the display of the choices.
Method validate Validate that the input is in self.choices.
Class Variable choices Undocumented
Instance Variable empty_label Undocumented
Instance Variable limit_choices_to Undocumented
Instance Variable queryset Undocumented
Instance Variable to_field_name Undocumented
Method _get_choices Undocumented
Method _get_queryset Undocumented
Method _set_queryset Undocumented
Instance Variable _queryset Undocumented

Inherited from ChoiceField (via ModelChoiceField):

Method valid_value Check to see if the provided value is a valid choice.
Method _set_choices Undocumented
Instance Variable _choices Undocumented

Inherited from Field (via ModelChoiceField, ChoiceField):

Method bound_data Return the value that should be shown for this field on render of a bound form, given the submitted POST data for the field and the initial data, if any.
Method get_bound_field Return a BoundField instance that will be used when accessing the form field in a template.
Method run_validators Undocumented
Method widget_attrs Given a Widget instance (*not* a Widget class), return a dictionary of any HTML attributes that should be added to the Widget, based on this Field.
Class Variable default_validators Undocumented
Class Variable empty_values Undocumented
Instance Variable disabled Undocumented
Instance Variable error_messages Undocumented
Instance Variable help_text Undocumented
Instance Variable initial Undocumented
Instance Variable label Undocumented
Instance Variable label_suffix Undocumented
Instance Variable localize Undocumented
Instance Variable required Undocumented
Instance Variable show_hidden_initial Undocumented
Instance Variable validators Undocumented
Instance Variable widget Undocumented
def __init__(self, queryset, **kwargs): (source)
def clean(self, value): (source)

Validate the given value and return its "cleaned" value as an appropriate Python object. Raise ValidationError for any errors.

def has_changed(self, initial, data): (source)

Return True if data differs from initial.

def prepare_value(self, value): (source)
def to_python(self, value): (source)
def _check_values(self, value): (source)

Given a list of possible PK values, return a QuerySet of the corresponding objects. Raise a ValidationError if a given value is invalid (not a valid PK, not in the queryset, etc.)