The horizon.forms.base Module

class horizon.forms.base.DateForm(*args, **kwargs)[source]

Bases: django.forms.forms.Form

A simple form for selecting a start date.

DateForm.base_fields = {'month': <django.forms.fields.ChoiceField object at 0x3033e90>, 'year': <django.forms.fields.ChoiceField object at 0x3033fd0>}
DateForm.media
class horizon.forms.base.SelfHandlingForm(*args, **kwargs)[source]

Bases: django.forms.forms.Form

A base Form class which includes processing logic in its subclasses and handling errors raised during form processing.

horizon.forms.base.method

A CharField instance rendered with a CharField widget which is automatically set to the value of the class name.

This is used to determine whether this form should handle the input it is given or not.

SelfHandlingForm.base_fields = {'method': <django.forms.fields.CharField object at 0x3033d90>}
SelfHandlingForm.get_success_url(request=None)[source]

Returns the URL to redirect to after a successful handling.

classmethod SelfHandlingForm.maybe_handle(request, *args, **kwargs)[source]

If the form is valid, maybe_handle() calls a handle(request, data) method on its subclass to determine what action to take.

Any exceptions raised during processing are captured and converted to messages.

SelfHandlingForm.media

Previous topic

The horizon.forms Module

Next topic

The horizon.forms.views Module

This Page