Generated: Wed 2013-03-13 13:05 CET
Source file: /home/tobi/Projects/cmsplugin-image-gallery/src/image_gallery/models.py
Stats: 8 executed, 0 missed, 7 excluded, 40 ignored
"""Models for the ``image_gallery`` app."""from django.db import modelsfrom django.utils.translation import ugettext_lazy as _from cms.models import CMSPluginfrom cms.models.fields import PlaceholderFieldfrom filer.fields.folder import FilerFolderFieldclass Gallery(models.Model): """ Model to display a filer folder's contents and provide extra information. :title: Gallery title. :date: Date/Time of the gallery event. :location: Location of the gallery items. :description: Description of the gallery. :folder: Linked folder of the filer app. """ title = models.CharField( max_length=100, verbose_name=_('Title'), ) date = models.DateTimeField( verbose_name=_('Date'), blank=True, null=True, ) location = models.CharField( max_length=100, verbose_name=_('Location'), blank=True, null=True, ) description = PlaceholderField( 'description', verbose_name=_('Description'), ) folder = FilerFolderField( verbose_name=_('Folder'), ) def __unicode__(self): return '{0}'.format(self.title)class GalleryPlugin(CMSPlugin): """Plugin model to link to a specific gallery instance.""" gallery = models.ForeignKey( Gallery, verbose_name=_('Gallery'), )