fairdm.contrib.contributors.forms.forms#
Inline formsets and forms for identifiers and affiliations.
Module Contents#
Classes#
Identifier formset that tells each form which types the other identifiers already use. |
|
Edit a persistent identifier, offering only types that suit the contributor and are not already used. |
|
Edit a person’s affiliation, setting the type of a new one from the organisation’s managers. |
API#
- class UserIdentifierFormSet(data=None, files=None, instance=None, save_as_new=False, prefix=None, queryset=None, **kwargs)#
Bases:
django.forms.models.BaseInlineFormSetIdentifier formset that tells each form which types the other identifiers already use.
Initialization
- get_form_kwargs(index)#
Pass the types used by the other identifiers to each form.
- class UserIdentifierForm(*args, **kwargs)#
Bases:
django.forms.ModelFormEdit a persistent identifier, offering only types that suit the contributor and are not already used.
Args: *args: Passed to
ModelForm. **kwargs: Passed toModelFormafter removingcontributor_instance, the contributor being edited, andexisting_types, the types already in use.Initialization
- class AffiliationForm(*args, **kwargs)#
Bases:
django.forms.ModelFormEdit a person’s affiliation, setting the type of a new one from the organisation’s managers.
A new affiliation is pending when the organisation has an owner or admin, and a member otherwise.
Attributes: organization: The organisation joined.
Initialization
- organization#
‘OrganizationChoiceField(…)’
- save(commit=True)#
Set the type of a new affiliation, then save.