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>)])
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>)])
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>)])
declared_fields = OrderedDict([('file_id', <django.forms.fields.IntegerField object>), ('radioUploadType', <django.forms.fields.ChoiceField object>), ('radioRepository', <django.forms.models.ModelChoiceField object>)])
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.

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