# -*- coding: utf-8 -*-
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
# -*- coding: utf-8 -*-
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.cache import get_cache
from django.core.urlresolvers import reverse
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.cache import get_cache
from django.core.urlresolvers import reverse
from piston.handler import AnonymousBaseHandler, BaseHandler
from piston.utils import rc
from sorl.thumbnail import default
from piston.handler import AnonymousBaseHandler, BaseHandler
from piston.utils import rc
from sorl.thumbnail import default
from catalogue.utils import related_tag_name
from picture.models import Picture
from picture.forms import PictureImportForm
from catalogue.utils import related_tag_name
from picture.models import Picture
from picture.forms import PictureImportForm
@classmethod
def director(cls, media):
return media.extra_info.get('director_name', '')
@classmethod
def director(cls, media):
return media.extra_info.get('director_name', '')
""" Returns details of a collection, identified by slug. """
try:
return Collection.objects.get(slug=slug)
""" Returns details of a collection, identified by slug. """
try:
return Collection.objects.get(slug=slug)
@classmethod
def book_changes(cls, request=None, since=0, until=None, fields=None):
@classmethod
def book_changes(cls, request=None, since=0, until=None, fields=None):
@classmethod
def tag_changes(cls, request=None, since=0, until=None, fields=None, categories=None):
@classmethod
def tag_changes(cls, request=None, since=0, until=None, fields=None, categories=None):
changes['updated'] = updated
for tag in Deleted.objects.filter(category__in=categories,
changes['updated'] = updated
for tag in Deleted.objects.filter(category__in=categories,