cdh.files.forms.fields module
- class cdh.files.forms.fields.FileField(queryset, *, max_length=None, allow_empty_file=False, **kwargs)[source]
Bases:
Field
Form field for the cdh.files.db.FileField
- bound_data(data, initial)[source]
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.
For most fields, this will simply be data; FileFields need to handle it a bit differently.
- clean(data, initial=None)[source]
Validate the given value and return its “cleaned” value as an appropriate Python object. Raise ValidationError for any errors.
- default_error_messages
- storage
- widget
alias of
SimpleFileInput
- class cdh.files.forms.fields.TrackedFileField(queryset, **kwargs)[source]
Bases:
ModelChoiceField
A MultipleChoiceField whose choices are a model QuerySet.
- clean(value)[source]
Validate the given value and return its “cleaned” value as an appropriate Python object. Raise ValidationError for any errors.
- default_error_messages = {'invalid_choice': 'Selecteer een geldige keuze. %(value)s is geen beschikbare keuze.', 'invalid_list': 'Voer een lijst met waarden in.', 'invalid_pk_value': '‘%(pk)s’ is geen geldige waarde.'}
alias of
MultipleHiddenInput
- widget
alias of
TrackedFileInput