akvo.rsr.models.project_document module

class akvo.rsr.models.project_document.ProjectDocument(id, project, url, document, format, title, title_language, language, document_date)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

categories

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.

clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

document

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
document_date

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

format

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

get_format_display(*, field=<akvo.rsr.fields.ValidXMLCharField: format>)
get_language_display(*, field=<akvo.rsr.fields.ValidXMLCharField: language>)
get_title_language_display(*, field=<akvo.rsr.fields.ValidXMLCharField: title_language>)
iati_format()[source]
iati_format_unicode()[source]
iati_language()[source]
iati_language_unicode()[source]
iati_title_language()[source]
iati_title_language_unicode()[source]
id

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

language

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

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

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

project_id
title

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

title_language

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

url

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

class akvo.rsr.models.project_document.ProjectDocumentCategory(id, document, category)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

category

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

document

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

document_id
get_category_display(*, field=<akvo.rsr.fields.ValidXMLCharField: category>)
iati_category()[source]
iati_category_unicode()[source]
id

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

objects = <django.db.models.manager.Manager object>
akvo.rsr.models.project_document.document_path(self, filename)[source]