ADMIN_MENU_ORDER = (
(_('Pages'), ('pages.Page', 'organization-featured.Featured', 'organization-pages.Home')),
- (_('Media'), ('organization-media.Video', 'organization-media.VideoCategory', 'organization-media.Audio', 'organization-media.Playlist', 'organization-media.Photo', (_('Media Library'), 'fb_browse'),)),
+ (_('Media'), ('organization-media.Video', 'organization-media.VideoCategory', 'organization-media.Audio', 'organization-media.Playlist', (_('Media Library'), 'fb_browse'),)),
(_('Events'), ('mezzanine_agenda.Event', 'mezzanine_agenda.EventLocation', 'mezzanine_agenda.EventCategory', 'mezzanine_agenda.EventPrice',)),
(_('Magazine'), ('organization-magazine.Article', 'organization-magazine.Brief',)),
(_('Organization'), ('organization-team.Organization', 'organization-team.Department', 'organization-team.Team', 'organization-team.Person', 'organization-team.Activity', 'organization-team.OrganizationType',)),
from mezzanine.pages.models import Page, RichText
from mezzanine.core.fields import RichTextField, OrderField, FileField
from mezzanine.core.models import Displayable, Slugged, Orderable
-from organization.media.models import Photo
+
COLOR_CHOICES = (('black', _('black')), ('yellow', _('yellow')), ('red', _('red')))
+ALIGNMENT_CHOICES = (('left', _('left')), ('center', _('center')), ('right', _('right')))
class Description(models.Model):
return self.name
+class Photo(models.Model):
+ """Photo bundle with credits"""
+
+ photo = FileField(_('photo'), upload_to='images/photos', max_length=1024, blank=True, format="Image")
+ photo_credits = models.CharField(_('photo credits'), max_length=255, blank=True, null=True)
+ photo_alignment = models.CharField(_('photo alignment'), choices=ALIGNMENT_CHOICES, max_length=32, default="left", blank=True)
+ photo_description = models.TextField(_('photo description'), blank=True)
+
+ photo_card = FileField(_('card photo'), upload_to='images/photos/card', max_length=1024, blank=True, format="Image")
+ photo_card_credits = models.CharField(_('photo card credits'), max_length=255, blank=True, null=True)
+
+ photo_slider = FileField(_('slider photo'), upload_to='images/photos/slider', max_length=1024, blank=True, format="Image")
+ photo_slider_credits = models.CharField(_('photo slider credits'), max_length=255, blank=True, null=True)
+ abstract = True
+
+ class Meta:
+ abstract = True
+
+ @property
+ def card(self):
+ if self.photo_card:
+ return self.photo_card
+ else:
+ return self.photo
+
+
class BasicPage(Page, SubTitle, Photo, RichText):
class Meta:
class Meta:
abstract = True
+
class Image(Description, Orderable):
file = FileField(_("Image"), max_length=1024, format="Image", upload_to="images")
from mezzanine.pages.models import Page
from organization.core.models import *
-from organization.media.models import *
import requests
from pyquery import PyQuery as pq
from mezzanine.pages.models import Page
from mezzanine.blog.models import BlogPost
#from orderable.models import Orderable
-from organization.core.models import Named, Description, Image
-from organization.media.models import Photo
+from organization.core.models import Named, Description, Image, Photo
class ArticleImage(Image):
from mezzanine_agenda.models import Event
from django.conf import settings
-ALIGNMENT_CHOICES = (('left', _('left')), ('center', _('center')), ('right', _('right')))
-MEDIA_BASE_URL = getattr(settings, 'MEDIA_BASE_URL', 'http://medias.ircam.fr/embed/media/')
-
-
-class Photo(models.Model):
- """Photo bundle with credits"""
-
- photo = FileField(_('photo'), upload_to='images/photos', max_length=1024, blank=True, format="Image")
- photo_credits = models.CharField(_('photo credits'), max_length=255, blank=True, null=True)
- photo_alignment = models.CharField(_('photo alignment'), choices=ALIGNMENT_CHOICES, max_length=32, default="left", blank=True)
- photo_description = models.TextField(_('photo description'), blank=True)
-
- photo_card = FileField(_('card photo'), upload_to='images/photos/card', max_length=1024, blank=True, format="Image")
- photo_card_credits = models.CharField(_('photo card credits'), max_length=255, blank=True, null=True)
-
- photo_slider = FileField(_('slider photo'), upload_to='images/photos/slider', max_length=1024, blank=True, format="Image")
- photo_slider_credits = models.CharField(_('photo slider credits'), max_length=255, blank=True, null=True)
- class Meta:
- abstract = True
-
- @property
- def card(self):
- if self.photo_card:
- return self.photo_card
- else:
- return self.photo
+MEDIA_BASE_URL = getattr(settings, 'MEDIA_BASE_URL', 'http://medias.ircam.fr/embed/media/')
class Media(Displayable, RichText):
from mezzanine.utils.models import AdminThumbMixin, upload_to
from mezzanine.galleries.models import BaseGallery
-from organization.media.models import Photo
from organization.core.models import *
from organization.magazine.models import Article