any_urlfield.forms¶
The AnyUrlField
class¶
-
class
any_urlfield.forms.
AnyUrlField
(url_type_registry, max_length=None, *args, **kwargs)¶ Form field that combines a Page ID and external page URL.
The form field is used automatically when the
AnyUrlField
is used in the model.-
clean
(value)¶ Validate every value in the given list. A value is validated against the corresponding Field in self.fields.
For example, if this MultiValueField was instantiated with fields=(DateField(), TimeField()), clean() would call DateField.clean(value[0]) and TimeField.clean(value[1]).
-
compress
(data_list)¶ Return a single value for the given list of values. The values can be assumed to be valid.
For example, if this MultiValueField was instantiated with fields=(DateField(), TimeField()), this might return a datetime object created by combining the date and time in data_list.
-
has_changed
(initial, data)¶ Return True if data differs from initial.
-
widget
¶ alias of
any_urlfield.forms.widgets.AnyUrlWidget
-
The AnyUrlWidget
class¶
The SimpleRawIdWidget
class¶
-
class
any_urlfield.forms.
SimpleRawIdWidget
(model, limit_choices_to=None, admin_site=None, attrs=None, using=None)¶ A wrapper class to create raw ID widgets.
It produces a same layout as the
raw_id_fields = (field',)
code does in the admin interface. This class wraps the functionality of the Django admin application into a usable format that is both compatible with Django 1.3 and 1.4.The basic invocation only requires the model:
widget = SimpleRawIdWidget(MyModel)
-
label_and_url_for_value
(value)¶ Optimize retrieval of the data. Because AnyUrlField.decompose() secretly returns both the ID, and it’s prefetched object, there is no need to refetch the object here.
-