Les galleries (gallery/
)¶
Module situé dans zds/gallery/
.
Fichiers documentés :
Modèles (models.py
)¶
-
class
zds.gallery.models.
Gallery
(id, title, subtitle, slug, pubdate, update)¶ -
-
get_gallery_path
()¶ Get the filesystem path to this gallery root.
Retourne: filesystem path to this gallery root Type retourné: unicode
-
get_images
()¶ Get all images in the gallery, ordered by publication date.
Retourne: all images in the gallery Type retourné: QuerySet
-
get_last_image
()¶ Get the last image added in the gallery.
Retourne: last image added in the gallery Type retourné: Image object
-
get_linked_users
()¶ Get all the linked users for this gallery whatever their rights
Retourne: all the linked users for this gallery Type retourné: QuerySet
-
-
class
zds.gallery.models.
Image
(*args, **kwargs)¶ Represent an image in database
-
class
zds.gallery.models.
UserGallery
(*args, **kwargs)¶ A gallery of images created by a user.
-
can_read
()¶ Check if user can read in the gallery.
Retourne: True if user can read in the gallery Type retourné: bool
-
can_write
()¶ Check if user can write in the gallery.
Retourne: True if user can write in the gallery Type retourné: bool
-
get_images
()¶ Get all images in the gallery.
Retourne: all images in the gallery Type retourné: QuerySet
-
-
zds.gallery.models.
auto_delete_file_on_delete
(sender, instance, **kwargs)¶ Deletes image from filesystem when corresponding object is deleted.
Retourne: nothing Type retourné: None
-
zds.gallery.models.
auto_delete_image_on_delete
(sender, instance, **kwargs)¶ Deletes image from filesystem when corresponding object is deleted.
Retourne: nothing Type retourné: None
-
zds.gallery.models.
image_path
(instance, filename)¶ Get the local filesystem path of the uploaded image. This function is used in models.
Paramètres: Retourne: local filesystem path of the uploaded image
Type retourné:
Vues (views.py
)¶
-
class
zds.gallery.views.
GalleryMixin
¶ Mixin that ensure the access to the gallery and fill context data properly
-
class
zds.gallery.views.
ImportImages
(**kwargs)¶ Create images from zip archive.
-
class
zds.gallery.views.
ListGallery
(**kwargs)¶ Display the gallery list with all their images
-
object
¶ alias de
UserGallery
-
-
class
zds.gallery.views.
NewGallery
(**kwargs)¶ Create a new gallery
-
class
zds.gallery.views.
NewImage
(**kwargs)¶ Creates a new image.
-
zds.gallery.views.
ensure_user_access
(gallery, user, can_write=False)¶ Paramètres: - gallery – the gallery
- user – user who want to access the gallery
- can_write – check if the user has the writing access to the gallery
Retourne: the gallery of the user
Type retourné: Lève: PermissionDenied – if the user has not access or no write permission (if applicable)