deposit.forms module

class deposit.forms.BaseMetadataForm(paper, **kwargs)[source]

Bases: django.forms.forms.Form

base_fields = OrderedDict([('paper_id', <django.forms.fields.IntegerField object>)])
declared_fields = OrderedDict([('paper_id', <django.forms.fields.IntegerField object>)])
media
class deposit.forms.FormWithAbstract(paper, **kwargs)[source]

Bases: deposit.forms.BaseMetadataForm

A simple metadata form, only including the abstract. Repositories can subclass this form to add more fields.

base_fields = OrderedDict([('paper_id', <django.forms.fields.IntegerField object>), ('abstract', <django.forms.fields.CharField object>)])
declared_fields = OrderedDict([('paper_id', <django.forms.fields.IntegerField object>), ('abstract', <django.forms.fields.CharField object>)])
media
class deposit.forms.PaperDepositForm(data=None, files=None, auto_id=u'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)[source]

Bases: django.forms.forms.Form

Main form for the deposit. It references both the file (as an ID) and the upload type.

base_fields = OrderedDict([('file_id', <django.forms.fields.IntegerField object>), ('radioUploadType', <django.forms.fields.ChoiceField object>), ('radioRepository', <django.forms.models.ModelChoiceField object>)])
clean_file_id()[source]
declared_fields = OrderedDict([('file_id', <django.forms.fields.IntegerField object>), ('radioUploadType', <django.forms.fields.ChoiceField object>), ('radioRepository', <django.forms.models.ModelChoiceField object>)])
media
deposit.forms.wrap_with_prefetch_status(baseWidget, get_callback, fieldname)[source]

Add a status text above the widget to display the prefetching status of the data in the field.

Parameters:
  • baseWidget – the Widget to be prefetched: the prefetching status will be displayed above that widget and its value will be set by the JS code
  • get_callback – function returning the AJAX URL where to get the prefetching status from. This is a callback and not a plain string for technical reasons (the URL cannot be computed before Django is fully loaded).
  • fieldname – The name of the field to be prefetched, passed to the AJAX callback.