fairdm.contrib.contributors.forms.organization#

Forms for creating and editing organisations.

Module Contents#

Classes#

OrganizationCreateForm

Create an organisation by ROR lookup or by entering its details.

OrganizationProfileForm

Edit an organisation’s logo, name, country, location and profile.

API#

class OrganizationCreateForm(*args, **kwargs)#

Bases: fairdm.forms.ModelForm

Create an organisation by ROR lookup or by entering its details.

Only the fields of the submitted action (from_ror or from_form) are required.

Args: *args: Passed to ModelForm. **kwargs: Passed to ModelForm.

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.ModelForm

Edit an organisation’s logo, name, country, location and profile.

Args: *args: Passed to ModelForm. **kwargs: Passed to ModelForm.

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.