photos package¶
Submodules¶
photos.admin module¶
-
class
photos.admin.AlbumAdmin(model, admin_site)[source]¶ Bases:
utils.translation.TranslatedModelAdmin-
date_hierarchy= 'date'¶
-
exclude= None¶
-
fields= ('title_en', 'title_nl', 'slug', 'date', 'hidden', 'shareable', 'album_archive', '_cover')¶
-
form¶ alias of
photos.forms.AlbumForm
-
get_queryset(request)[source]¶ Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
-
list_display= ('title', 'date', 'num_photos', 'hidden', 'shareable')¶
-
list_filter= ('hidden', 'shareable')¶
-
property
media¶
-
prepopulated_fields= {'slug': ('date', 'title_en')}¶
-
search_fields= ('title_en', 'title_nl', 'date')¶
-
photos.apps module¶
photos.forms module¶
-
class
photos.forms.AlbumForm(*args, **kwargs)[source]¶ Bases:
django.forms.models.ModelForm-
base_fields= {'album_archive': <django.forms.fields.FileField object>}¶
-
declared_fields= {'album_archive': <django.forms.fields.FileField object>}¶
-
property
media¶ Return all media required to render the widgets on this form.
-
photos.models module¶
-
class
photos.models.Album(id, dirname, date, slug, hidden, new_album_notification, _cover, shareable, title_en, title_nl)[source]¶ Bases:
django.db.models.base.Model-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
-
property
access_token¶
-
cover¶
-
date¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
dirname¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_next_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=True, **kwargs)¶
-
get_previous_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=False, **kwargs)¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
new_album_notification¶ 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.parentis aForwardManyToOneDescriptorinstance.
-
new_album_notification_id¶
-
objects= <django.db.models.manager.Manager object>¶
-
photo_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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
photosdir= 'photos'¶
-
photospath= '/__w/concrexit/concrexit/website/media/photos'¶
-
save(*args, **kwargs)[source]¶ Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
slug¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
property
title¶ Accessor that fetches the localized variant of title
-
title_en¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
title_nl¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
-
class
photos.models.Photo(id, album, file, rotation, hidden, _digest)[source]¶ Bases:
django.db.models.base.Model-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
-
album¶ 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.parentis aForwardManyToOneDescriptorinstance.
-
album_id¶
-
covered_album¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurantis aReverseOneToOneDescriptorinstance.
-
file¶ Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.
-
get_rotation_display(*, field=<django.db.models.fields.IntegerField: rotation>)¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
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>¶
-
rotation¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
photos.services module¶
photos.signals module¶
photos.urls module¶
photos.validators module¶
-
class
photos.validators.ArchiveFileTypeValidator(*args, **kwargs)[source]¶ Bases:
object-
deconstruct()¶ Return a 3-tuple of class import path, positional arguments, and keyword arguments.
-
message= 'Only zip and tar files are allowed.'¶
-
types= ['application/gzip', 'application/zip', 'application/x-gzip']¶
-