org.forms.extensions
Attributes
Classes
Enables the extension of form definitions/submissions. |
|
Enables the extension of form definitions/submissions. |
|
Enables the extension of form definitions/submissions. |
|
Enables the extension of form definitions/submissions. |
|
Can be used with TimezonePublicationMixin or UTCDateTime type decorator. |
|
Enables the extension of form definitions/submissions. |
Module Contents
- class org.forms.extensions.CoordinatesFormExtension(form_class: type[_FormT])[source]
Bases:
onegov.form.extensions.FormExtension
[FormT
]Enables the extension of form definitions/submissions.
When either of those models create a form class they will take the ‘extensions’ key in the meta dictionary to extend those formcode based forms.
This allows for specialised behaviour of formcode forms with the drawback that those definitions/submissions are more tightly bound to the code. That is to say code in module A could not use submissions defined by module B unless module B is also present in the path.
To create and register a form extension subclass as follows:
class MyExtension(FormExtension, name='my-extension'): def create(self): return self.form_class
Note that you should not change the form_class provided to you. Instead you should subclass it. If you need to change the form class, you need to clone it:
class MyExtension(FormExtension, name='my-extension'): def create(self): return self.form_class.clone() class MyExtension(FormExtension, name='my-extension'): def create(self): class ExtendedForm(self.form_class): pass return ExtendedForm
Also, names must be unique and can only be registered once.
- class org.forms.extensions.SubmitterFormExtension(form_class: type[_FormT])[source]
Bases:
onegov.form.extensions.FormExtension
[FormT
]Enables the extension of form definitions/submissions.
When either of those models create a form class they will take the ‘extensions’ key in the meta dictionary to extend those formcode based forms.
This allows for specialised behaviour of formcode forms with the drawback that those definitions/submissions are more tightly bound to the code. That is to say code in module A could not use submissions defined by module B unless module B is also present in the path.
To create and register a form extension subclass as follows:
class MyExtension(FormExtension, name='my-extension'): def create(self): return self.form_class
Note that you should not change the form_class provided to you. Instead you should subclass it. If you need to change the form class, you need to clone it:
class MyExtension(FormExtension, name='my-extension'): def create(self): return self.form_class.clone() class MyExtension(FormExtension, name='my-extension'): def create(self): class ExtendedForm(self.form_class): pass return ExtendedForm
Also, names must be unique and can only be registered once.
- class org.forms.extensions.CommentFormExtension(form_class: type[_FormT])[source]
Bases:
onegov.form.extensions.FormExtension
[FormT
]Enables the extension of form definitions/submissions.
When either of those models create a form class they will take the ‘extensions’ key in the meta dictionary to extend those formcode based forms.
This allows for specialised behaviour of formcode forms with the drawback that those definitions/submissions are more tightly bound to the code. That is to say code in module A could not use submissions defined by module B unless module B is also present in the path.
To create and register a form extension subclass as follows:
class MyExtension(FormExtension, name='my-extension'): def create(self): return self.form_class
Note that you should not change the form_class provided to you. Instead you should subclass it. If you need to change the form class, you need to clone it:
class MyExtension(FormExtension, name='my-extension'): def create(self): return self.form_class.clone() class MyExtension(FormExtension, name='my-extension'): def create(self): class ExtendedForm(self.form_class): pass return ExtendedForm
Also, names must be unique and can only be registered once.
- class org.forms.extensions.ChangeRequestFormExtension(form_class: type[_FormT])[source]
Bases:
onegov.form.extensions.FormExtension
[FormT
]Enables the extension of form definitions/submissions.
When either of those models create a form class they will take the ‘extensions’ key in the meta dictionary to extend those formcode based forms.
This allows for specialised behaviour of formcode forms with the drawback that those definitions/submissions are more tightly bound to the code. That is to say code in module A could not use submissions defined by module B unless module B is also present in the path.
To create and register a form extension subclass as follows:
class MyExtension(FormExtension, name='my-extension'): def create(self): return self.form_class
Note that you should not change the form_class provided to you. Instead you should subclass it. If you need to change the form class, you need to clone it:
class MyExtension(FormExtension, name='my-extension'): def create(self): return self.form_class.clone() class MyExtension(FormExtension, name='my-extension'): def create(self): class ExtendedForm(self.form_class): pass return ExtendedForm
Also, names must be unique and can only be registered once.
- class org.forms.extensions.PublicationFormExtension(form_class: type[_FormT])[source]
Bases:
onegov.form.extensions.FormExtension
[FormT
]Can be used with TimezonePublicationMixin or UTCDateTime type decorator.
- class org.forms.extensions.HoneyPotFormExtension(form_class: type[_FormT])[source]
Bases:
onegov.form.extensions.FormExtension
[FormT
]Enables the extension of form definitions/submissions.
When either of those models create a form class they will take the ‘extensions’ key in the meta dictionary to extend those formcode based forms.
This allows for specialised behaviour of formcode forms with the drawback that those definitions/submissions are more tightly bound to the code. That is to say code in module A could not use submissions defined by module B unless module B is also present in the path.
To create and register a form extension subclass as follows:
class MyExtension(FormExtension, name='my-extension'): def create(self): return self.form_class
Note that you should not change the form_class provided to you. Instead you should subclass it. If you need to change the form class, you need to clone it:
class MyExtension(FormExtension, name='my-extension'): def create(self): return self.form_class.clone() class MyExtension(FormExtension, name='my-extension'): def create(self): class ExtendedForm(self.form_class): pass return ExtendedForm
Also, names must be unique and can only be registered once.