fairdm.contrib.contributors.forms.organization#
Forms for creating and editing organisations.
Module Contents#
Classes#
Create an organisation by ROR lookup or by entering its details. |
|
Edit an organisation’s logo, name, country, location and profile. |
API#
- class OrganizationCreateForm(*args, **kwargs)#
Bases:
fairdm.forms.ModelFormCreate an organisation by ROR lookup or by entering its details.
Only the fields of the submitted
action(from_rororfrom_form) are required.Args: *args: Passed to
ModelForm. **kwargs: Passed toModelForm.Attributes: from_ror: The ROR record to look up. country: The organisation’s country. location: The organisation’s point in WGS 84, typed as a latitude and a longitude.
Initialization
- from_ror#
‘RorChoiceField(…)’
- country#
‘ChoiceField(…)’
- location#
‘LocationField(…)’
- class Meta#
- model#
None
- fields#
[‘from_ror’, ‘name’, ‘location’, ‘country’]
- labels#
None
- help_texts#
None
- clean_location()#
Keep the point of the cleaned location, which the model field takes.
- clean_name()#
Require a name when adding manually.
- clean_country()#
Require a country when adding manually.
- clean_from_ror()#
Require a ROR id when searching ROR.
- save(commit: bool = True)#
Create the organisation from ROR, or save the entered details.
- class OrganizationProfileForm(*args, **kwargs)#
Bases:
fairdm.forms.ModelFormEdit an organisation’s logo, name, country, location and profile.
Args: *args: Passed to
ModelForm. **kwargs: Passed toModelForm.Attributes: country: The organisation’s country. location: The organisation’s point in WGS 84, typed as a latitude and a longitude.
Initialization
- country#
‘ChoiceField(…)’
- location#
‘LocationField(…)’
- class Meta#
- model#
None
- fields#
[‘image’, ‘name’, ‘country’, ‘location’, ‘profile’]
- labels#
None
- help_texts#
None
- clean_location()#
Keep the point of the cleaned location, which the model field takes.