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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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.

file

The file itself

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

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

num_pages

Number of pages

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

How it was uploaded: either filename or URL

thumbnail

A thumbnail of the first page

timestamp

When it was uploaded

user

The user who uploaded that file

user_id

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