--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-07-05 15:02
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('custom', '0002_auto_20160705_1559'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='basicpage',
+ name='sub_title',
+ field=models.CharField(blank=True, max_length=1000, verbose_name='sub title'),
+ ),
+ migrations.AlterField(
+ model_name='basicpage',
+ name='sub_title_en',
+ field=models.CharField(blank=True, max_length=1000, null=True, verbose_name='sub title'),
+ ),
+ migrations.AlterField(
+ model_name='basicpage',
+ name='sub_title_fr',
+ field=models.CharField(blank=True, max_length=1000, null=True, verbose_name='sub title'),
+ ),
+ ]
--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-07-05 16:10
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('custom', '0003_auto_20160705_1702'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='basicpage',
+ name='photo',
+ field=mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='photo'),
+ ),
+ migrations.AddField(
+ model_name='basicpage',
+ name='photo_alignment',
+ field=models.CharField(blank=True, choices=[('left', 'left'), ('right', 'right')], default='left', max_length=32, verbose_name='photo alignment'),
+ ),
+ migrations.AddField(
+ model_name='basicpage',
+ name='photo_credits',
+ field=models.CharField(blank=True, max_length=255, null=True, verbose_name='photo credits'),
+ ),
+ migrations.AddField(
+ model_name='basicpage',
+ name='photo_description',
+ field=models.TextField(blank=True, verbose_name='photo description'),
+ ),
+ migrations.AddField(
+ model_name='basicpage',
+ name='photo_featured',
+ field=mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='photo featured'),
+ ),
+ migrations.AddField(
+ model_name='basicpage',
+ name='photo_featured_credits',
+ field=models.CharField(blank=True, max_length=255, null=True, verbose_name='photo featured credits'),
+ ),
+ ]
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse, reverse_lazy
-#from mezzanine.core.models import Displayable
from mezzanine.pages.models import Page, RichText
-# Create your models here.
-# class DisplayableCustom(Displayable):
-#
-# sub_title = models.TextField(_('sub_title'), blank=True)
+from mezzanine.core.fields import RichTextField, OrderField, FileField
+ALIGNMENT_CHOICES = (('left', _('left')), ('right', _('right')))
class SubTitle(models.Model):
class BasicPage(Page, RichText):
- sub_title = models.TextField(_('sub title'), blank=True)
+ sub_title = models.CharField(_('sub title'), blank=True, max_length=1000)
+ # description = models.TextField(_('description'), blank=True)
+ 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_featured = FileField(_('photo featured'), upload_to='images/photos', max_length=1024, blank=True, format="Image")
+ photo_featured_credits = models.CharField(_('photo featured credits'), max_length=255, blank=True, null=True)
-# from modeltranslation.translator import translator, register, TranslationOptions
-# from mezzanine.pages.models import Page, RichTextPage, Link
-# from mezzanine.pages.translation import TranslatedRichText
-# from mezzanine.forms.models import Form
-# from mezzanine.galleries.models import Gallery
-#
-# # @register(RichText)
-# # class RichTextTranslationOptions(TranslatedRichText):
-# #
-# # fields = ('sub_title')
-#
-# # print(RichTextPage._meta.get_fields())
-# # print('///////////////////////////')
-# class TranslatedInjectedRichText(TranslatedRichText):
-# fields = ('sub_title',)
-#
-# translator.unregister(RichTextPage)
-#
-# translator.register(RichTextPage, TranslatedInjectedRichText)
-
-
from modeltranslation.translator import translator, register, TranslationOptions
from mezzanine.pages.models import Page, RichText
from mezzanine.pages.translation import TranslatedRichText