You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
946 B
31 lines
946 B
import warnings
|
|
from django.conf import settings
|
|
from django.views.generic import DetailView, ListView
|
|
from photologue.models import Gallery, Photo
|
|
|
|
|
|
# Number of galleries to display per page.
|
|
GALLERY_PAGINATE_BY = getattr(settings, 'PHOTOLOGUE_GALLERY_PAGINATE_BY', 20)
|
|
|
|
if GALLERY_PAGINATE_BY != 20:
|
|
warnings.warn(
|
|
DeprecationWarning('PHOTOLOGUE_GALLERY_PAGINATE_BY setting will be removed in Photologue 3.1'))
|
|
|
|
# Number of photos to display per page.
|
|
PHOTO_PAGINATE_BY = getattr(settings, 'PHOTOLOGUE_PHOTO_PAGINATE_BY', 20)
|
|
|
|
if PHOTO_PAGINATE_BY != 20:
|
|
warnings.warn(
|
|
DeprecationWarning('PHOTOLOGUE_PHOTO_PAGINATE_BY setting will be removed in Photologue 3.1'))
|
|
|
|
class GalleryView(DetailView):
|
|
model = Gallery
|
|
slug_field = 'slug'
|
|
template_name = 'client/photoreport/gallery.html'
|
|
|
|
|
|
class PhotoView(DetailView):
|
|
model = Photo
|
|
slug_field = 'slug'
|
|
template_name = 'client/photoreport/photo.html'
|
|
|
|
|