Zeste de Savoir
latest
  • Installation
  • Workflow et détails pratiques
  • Le back-end
  • Documentation technique du back-end
    • Arborescence du back-end
    • Les outils de mises en avant (featured/)
    • Les forums (forum/)
    • Les galleries (gallery/)
      • Modèles (models.py)
      • Vues (views.py)
    • Les membres (member/)
    • Les pages (pages/)
    • Les messages privés (mp/)
    • La recherche (searchv2/)
    • Les tutoriels v2 (ZEP12) (tutorialv2/)
    • Les utilitaires (utils/)
  • Le front-end
  • API
  • Makefile et autres outils
Zeste de Savoir
  • Docs »
  • Documentation technique du back-end »
  • Les galleries (gallery/)
  • Edit on GitHub

Les galleries (gallery/)¶

Module situé dans zds/gallery/.

Fichiers documentés :

  • Les galleries (gallery/)
    • Modèles (models.py)
    • Vues (views.py)

Modèles (models.py)¶

class zds.gallery.models.Gallery(id, title, subtitle, slug, pubdate, update)¶
get_absolute_url()¶

URL of a single Gallery.

Retourne:Gallery object URL
Type retourné:str
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

get_absolute_url()¶

URL of a single Image.

Retourne:Image object URL
Type retourné:str
get_extension()¶

Get the extension of an image (used in tests).

Retourne:the extension of the image
Type retourné:unicode
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:
  • instance (str) – an instance of the model where the ImageField is defined
  • filename (str) – the filename that was originally given to the file
Retourne:

local filesystem path of the uploaded image

Type retourné:

unicode

Vues (views.py)¶

class zds.gallery.views.DeleteImages(**kwargs)¶

Delete a given image

model¶

alias de Image

class zds.gallery.views.EditGallery(**kwargs)¶

Update gallery information

model¶

alias de Gallery

class zds.gallery.views.EditImage(**kwargs)¶

Edit or view an existing image.

model¶

alias de Image

class zds.gallery.views.GalleryDetails(**kwargs)¶

Gallery details

object¶

alias de UserGallery

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é:

UserGallery

Lève:

PermissionDenied – if the user has not access or no write permission (if applicable)

Next Previous

© Copyright 2017, zestedesavoir. Revision e6943004.

Built with Sphinx using a theme provided by Read the Docs.