upload.models module

class upload.models.UploadedPDF(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A PDF file, plus some useful info about who/when/how it was uploaded.

Parameters:
  • id (AutoField) – Id
  • user_id (ForeignKey) – User
  • timestamp (DateTimeField) – Timestamp
  • orig_name (CharField) – Orig name
  • num_pages (IntegerField) – Num pages
  • file (FileField) – File
  • thumbnail (FileField) – Thumbnail
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception UploadedPDF.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

UploadedPDF.depositrecord_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

UploadedPDF.file

The file itself

UploadedPDF.get_next_by_timestamp(*moreargs, **morekwargs)
UploadedPDF.get_previous_by_timestamp(*moreargs, **morekwargs)
UploadedPDF.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

UploadedPDF.num_pages

Number of pages

UploadedPDF.objects = <django.db.models.manager.Manager object>
UploadedPDF.orig_name

How it was uploaded: either filename or URL

UploadedPDF.thumbnail

A thumbnail of the first page

UploadedPDF.timestamp

When it was uploaded

UploadedPDF.user

The user who uploaded that file

UploadedPDF.user_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.