profiles.forms module

class profiles.forms.ProfileForm(*args, **kwargs)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

model

alias of profiles.models.Profile

fields = ['title', 'first_name', 'last_name', 'orcid_id', 'webpage', 'acad_field', 'specialties', 'topics', 'accepts_SciPost_emails', 'accepts_refereeing_requests', 'instance_from_type', 'instance_pk']
clean_email()[source]

Check that the email isn’t yet associated to an existing Profile.

clean_instance_from_type()[source]

Check that only recognized types are used.

save()[source]

Save this form’s self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance.

base_fields = {'acad_field': <django.forms.models.ModelChoiceField object>, 'accepts_SciPost_emails': <django.forms.fields.BooleanField object>, 'accepts_refereeing_requests': <django.forms.fields.BooleanField object>, 'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'instance_from_type': <django.forms.fields.CharField object>, 'instance_pk': <django.forms.fields.IntegerField object>, 'last_name': <django.forms.fields.CharField object>, 'orcid_id': <django.forms.fields.CharField object>, 'specialties': <django.forms.models.ModelMultipleChoiceField object>, 'title': <django.forms.fields.TypedChoiceField object>, 'topics': <django.forms.models.ModelMultipleChoiceField object>, 'webpage': <django.forms.fields.URLField object>}
declared_fields = {'email': <django.forms.fields.EmailField object>, 'instance_from_type': <django.forms.fields.CharField object>, 'instance_pk': <django.forms.fields.IntegerField object>}
property media
class profiles.forms.SimpleProfileForm(*args, **kwargs)[source]

Bases: profiles.forms.ProfileForm

Simple version of ProfileForm, displaying only required fields.

base_fields = {'acad_field': <django.forms.models.ModelChoiceField object>, 'accepts_SciPost_emails': <django.forms.fields.BooleanField object>, 'accepts_refereeing_requests': <django.forms.fields.BooleanField object>, 'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'instance_from_type': <django.forms.fields.CharField object>, 'instance_pk': <django.forms.fields.IntegerField object>, 'last_name': <django.forms.fields.CharField object>, 'orcid_id': <django.forms.fields.CharField object>, 'specialties': <django.forms.models.ModelMultipleChoiceField object>, 'title': <django.forms.fields.TypedChoiceField object>, 'topics': <django.forms.models.ModelMultipleChoiceField object>, 'webpage': <django.forms.fields.URLField object>}
declared_fields = {'email': <django.forms.fields.EmailField object>, 'instance_from_type': <django.forms.fields.CharField object>, 'instance_pk': <django.forms.fields.IntegerField object>}
property media
class profiles.forms.ProfileMergeForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

clean()[source]

To merge Profiles, they must be distinct, and it must not be the case that they both are associated to a Contributor instance (which would mean two Contributor objects for the same person).

save()[source]

Perform the actual merge: save all data from to-be-deleted profile into the one to be kept.

base_fields = {'to_merge': <common.forms.ModelChoiceFieldwithid object>, 'to_merge_into': <common.forms.ModelChoiceFieldwithid object>}
declared_fields = {'to_merge': <common.forms.ModelChoiceFieldwithid object>, 'to_merge_into': <common.forms.ModelChoiceFieldwithid object>}
property media
class profiles.forms.ProfileEmailForm(*args, **kwargs)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

model

alias of profiles.models.ProfileEmail

fields = ['email', 'still_valid', 'primary']
clean_email()[source]

Check if profile/email combination exists.

save()[source]

Save to a profile.

base_fields = {'email': <django.forms.fields.EmailField object>, 'primary': <django.forms.fields.BooleanField object>, 'still_valid': <django.forms.fields.BooleanField object>}
declared_fields = {}
property media
class profiles.forms.ProfileSelectForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

base_fields = {'profile': <django.forms.models.ModelChoiceField object>}
declared_fields = {'profile': <django.forms.models.ModelChoiceField object>}
property media
class profiles.forms.ProfileDynSelForm(*args, **kwargs)[source]

Bases: django.forms.forms.Form

search_results()[source]
base_fields = {'action_target_element_id': <django.forms.fields.CharField object>, 'action_url_base_kwargs': <django.forms.fields.JSONField object>, 'action_url_name': <django.forms.fields.CharField object>, 'q': <django.forms.fields.CharField object>}
declared_fields = {'action_target_element_id': <django.forms.fields.CharField object>, 'action_url_base_kwargs': <django.forms.fields.JSONField object>, 'action_url_name': <django.forms.fields.CharField object>, 'q': <django.forms.fields.CharField object>}
property media
class profiles.forms.AffiliationForm(*args, **kwargs)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

model

alias of profiles.models.Affiliation

fields = ['profile', 'organization', 'category', 'description', 'date_from', 'date_until']
base_fields = {'category': <django.forms.fields.TypedChoiceField object>, 'date_from': <django.forms.fields.DateField object>, 'date_until': <django.forms.fields.DateField object>, 'description': <django.forms.fields.CharField object>, 'organization': <django.forms.models.ModelChoiceField object>, 'profile': <django.forms.models.ModelChoiceField object>}
declared_fields = {'organization': <django.forms.models.ModelChoiceField object>}
property media