From: Guillaume Pellerin Date: Tue, 2 Feb 2016 00:06:51 +0000 (+0100) Subject: add festival app first models and views, goto postgresql, no eve for the moment bacau... X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=fb259f77191525dccc0218a7a72815aad9859c1f;p=mezzo.git add festival app first models and views, goto postgresql, no eve for the moment bacause cannot have cool FK between 2 DBs :( --- diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..0d5058b4 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "app/apps/presta2eve"] + path = app/apps/presta2eve + url = git+ssh://git@git.forge.ircam.fr/presta2eve.git diff --git a/README.rst b/README.rst index 2632dfa3..217934d4 100644 --- a/README.rst +++ b/README.rst @@ -4,6 +4,7 @@ Manifeste IRCAM This is the new template for the Manifeste festival website at IRCAM. It is based on the Mezzanine CMS which is itself based on Django. + Install ========= @@ -11,6 +12,7 @@ For easier development and production workflow, it has been dockerized including First install `Git `_, `Docker engine `_ and `docker-compose `_. + Linux ------ @@ -24,9 +26,11 @@ To restore the backuped database, in another terminal:: cd Manifeste docker-compose run db /srv/backup/restore_db.sh + docker-compose run pgdb /srv/backup/restore_db_eve.sh You should be able to browse the site at http://localhost:8010/ + MacOS or Windows: ------------------ @@ -44,6 +48,7 @@ Then, in another terminal:: eval "$(docker-machine env manifeste)" cd Manifeste docker-compose run db /srv/backup/restore_db.sh + docker-compose run pgdb /srv/backup/restore_db_eve.sh `More info `_ about using docker and related tools. diff --git a/app/apps/presta2eve b/app/apps/presta2eve new file mode 160000 index 00000000..78bcac45 --- /dev/null +++ b/app/apps/presta2eve @@ -0,0 +1 @@ +Subproject commit 78bcac45c47ffd7a6f41efa55eac76755a8153ad diff --git a/app/deploy/start_app.sh b/app/deploy/start_app.sh index b8ea0e30..d986ac42 100644 --- a/app/deploy/start_app.sh +++ b/app/deploy/start_app.sh @@ -25,11 +25,13 @@ sh $app/deploy/wait.sh # waiting for available database # python $app/wait.py +# python $manage wait-for-db-connection # django init # python $manage syncdb --noinput python $manage migrate --noinput python $manage collectstatic --noinput +python $manage create-admin-user # static files auto update watchmedo shell-command --patterns="*.js;*.css" --recursive \ diff --git a/app/festival/__init__.py b/app/festival/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/app/festival/admin.py b/app/festival/admin.py new file mode 100644 index 00000000..2b6d01cb --- /dev/null +++ b/app/festival/admin.py @@ -0,0 +1,7 @@ +from django.contrib import admin +from festival.models import * + +admin.site.register(Event) +admin.site.register(Artist) +admin.site.register(Location) +admin.site.register(Video) diff --git a/app/festival/management/__init__.py b/app/festival/management/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/app/festival/management/commands/__init__.py b/app/festival/management/commands/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/app/festival/management/commands/create-admin-user.py b/app/festival/management/commands/create-admin-user.py new file mode 100644 index 00000000..23a274f7 --- /dev/null +++ b/app/festival/management/commands/create-admin-user.py @@ -0,0 +1,24 @@ +from optparse import make_option +from django.conf import settings +from django.core.management.base import BaseCommand, CommandError +from django.contrib.auth.models import User + + +class Command(BaseCommand): + help = """Create a default admin user if it doesn't exist. + you SHOULD change the password and the email afterwards!""" + + username = 'admin' + password = 'admin' + email = 'root@example.com' + + def handle(self, *args, **options): + admin = User.objects.filter(username=self.username) + if not admin: + user = User(username=self.username) + user.set_password(self.password) + user.email = self.email + user.is_superuser = True + user.is_staff = True + user.save() + print 'User "'+ self.username + '" created' diff --git a/app/festival/management/commands/wait-for-db-connection.py b/app/festival/management/commands/wait-for-db-connection.py new file mode 100644 index 00000000..71f3b033 --- /dev/null +++ b/app/festival/management/commands/wait-for-db-connection.py @@ -0,0 +1,16 @@ +from django.conf import settings +from django.core.management.base import BaseCommand, CommandError +from django.db import connection + + +class Command(BaseCommand): + help = "Wait for database connection" + + def handle(self, *args, **options): + up = False + while not up: + try: + cursor = connection.cursor() + up = True + except: + time.sleep(1) diff --git a/app/festival/migrations/0001_initial.py b/app/festival/migrations/0001_initial.py new file mode 100644 index 00000000..dc398e81 --- /dev/null +++ b/app/festival/migrations/0001_initial.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('sites', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Artist', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('name', models.CharField(max_length=255, verbose_name='name')), + ('photo', models.ImageField(upload_to=b'photos/%Y/%m/%d', max_length=1024, verbose_name='photo')), + ], + ), + migrations.CreateModel( + name='Event', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('keywords_string', models.CharField(max_length=500, editable=False, blank=True)), + ('title', models.CharField(max_length=500, verbose_name='Title')), + ('slug', models.CharField(help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL', blank=True)), + ('_meta_title', models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True)), + ('description', models.TextField(verbose_name='Description', blank=True)), + ('gen_description', models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description')), + ('created', models.DateTimeField(null=True, editable=False)), + ('updated', models.DateTimeField(null=True, editable=False)), + ('status', models.IntegerField(default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status', choices=[(1, 'Draft'), (2, 'Published')])), + ('publish_date', models.DateTimeField(help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from', db_index=True, blank=True)), + ('expiry_date', models.DateTimeField(help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on', blank=True)), + ('short_url', models.URLField(null=True, blank=True)), + ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')), + ('event_id', models.IntegerField()), + ('artists', models.ManyToManyField(related_name='events', null=True, verbose_name='events', to='festival.Artist', blank=True)), + ('site', models.ForeignKey(editable=False, to='sites.Site')), + ], + options={ + 'db_table': 'event', + 'verbose_name': 'event', + }, + ), + migrations.CreateModel( + name='Location', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('location_id', models.IntegerField()), + ], + ), + migrations.CreateModel( + name='Video', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('keywords_string', models.CharField(max_length=500, editable=False, blank=True)), + ('title', models.CharField(max_length=500, verbose_name='Title')), + ('slug', models.CharField(help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL', blank=True)), + ('_meta_title', models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True)), + ('description', models.TextField(verbose_name='Description', blank=True)), + ('gen_description', models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description')), + ('created', models.DateTimeField(null=True, editable=False)), + ('updated', models.DateTimeField(null=True, editable=False)), + ('status', models.IntegerField(default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status', choices=[(1, 'Draft'), (2, 'Published')])), + ('publish_date', models.DateTimeField(help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from', db_index=True, blank=True)), + ('expiry_date', models.DateTimeField(help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on', blank=True)), + ('short_url', models.URLField(null=True, blank=True)), + ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')), + ('media_id', models.IntegerField(verbose_name='media ID')), + ('artists', models.ManyToManyField(related_name='videos', null=True, verbose_name='artists', to='festival.Artist', blank=True)), + ('site', models.ForeignKey(editable=False, to='sites.Site')), + ], + options={ + 'abstract': False, + }, + ), + ] diff --git a/app/festival/migrations/0002_auto_20160201_2339.py b/app/festival/migrations/0002_auto_20160201_2339.py new file mode 100644 index 00000000..95250449 --- /dev/null +++ b/app/festival/migrations/0002_auto_20160201_2339.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('festival', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='event', + name='artists', + field=models.ManyToManyField(related_name='events', verbose_name='events', to='festival.Artist', blank=True), + ), + migrations.AlterField( + model_name='video', + name='artists', + field=models.ManyToManyField(related_name='videos', verbose_name='artists', to='festival.Artist', blank=True), + ), + ] diff --git a/app/festival/migrations/0003_artist_content.py b/app/festival/migrations/0003_artist_content.py new file mode 100644 index 00000000..18d6d86c --- /dev/null +++ b/app/festival/migrations/0003_artist_content.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import mezzanine.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('festival', '0002_auto_20160201_2339'), + ] + + operations = [ + migrations.AddField( + model_name='artist', + name='content', + field=mezzanine.core.fields.RichTextField(default='', verbose_name='Content'), + preserve_default=False, + ), + ] diff --git a/app/festival/migrations/0004_auto_20160202_0002.py b/app/festival/migrations/0004_auto_20160202_0002.py new file mode 100644 index 00000000..f72243ea --- /dev/null +++ b/app/festival/migrations/0004_auto_20160202_0002.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import mezzanine.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('festival', '0003_artist_content'), + ] + + operations = [ + migrations.RemoveField( + model_name='artist', + name='content', + ), + migrations.AddField( + model_name='artist', + name='bio', + field=mezzanine.core.fields.RichTextField(null=True, verbose_name='bio', blank=True), + ), + ] diff --git a/app/festival/migrations/0005_auto_20160202_0006.py b/app/festival/migrations/0005_auto_20160202_0006.py new file mode 100644 index 00000000..042cfb63 --- /dev/null +++ b/app/festival/migrations/0005_auto_20160202_0006.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('festival', '0004_auto_20160202_0002'), + ] + + operations = [ + migrations.AddField( + model_name='artist', + name='photo_credits', + field=models.CharField(max_length=255, null=True, verbose_name='photo credits', blank=True), + ), + migrations.AlterField( + model_name='event', + name='artists', + field=models.ManyToManyField(related_name='events', verbose_name='artists', to='festival.Artist', blank=True), + ), + ] diff --git a/app/festival/migrations/__init__.py b/app/festival/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/app/festival/models.py b/app/festival/models.py new file mode 100644 index 00000000..54fd0a65 --- /dev/null +++ b/app/festival/models.py @@ -0,0 +1,63 @@ +from django.db import models +from django.utils.translation import ugettext_lazy as _ + +from mezzanine.core.models import RichText, Displayable +from mezzanine.core.fields import RichTextField, OrderField + +import eve.models + +from .related import SpanningForeignKey + + +class MetaCore: + + app_label = 'festival' + + +class Event(Displayable): + """(Event description)""" + + event_id = models.IntegerField() + # event = SpanningForeignKey(eve.models.EventVersion, related_name='festival_events', verbose_name=_('E-venement event'), blank=True, null=True, default=None) + rich_description = RichText(_('rich description')) + artists = models.ManyToManyField('Artist', related_name='events', verbose_name=_('artists'), blank=True) + + class Meta(MetaCore): + verbose_name = _('event') + db_table = 'event' + + def __unicode__(self): + return self.title + + +class Artist(models.Model): + """(Artist description)""" + + name = models.CharField(_('name'), max_length=255) + photo = models.ImageField(_('photo'), upload_to='photos/%Y/%m/%d', max_length=1024) + photo_credits = models.CharField(_('photo credits'), max_length=255, blank=True, null=True) + bio = RichTextField(_("bio"), blank=True, null=True) + + search_fields = ("name", "bio") + + def __unicode__(self): + return self.name + + +class Video(Displayable): + """(Video description)""" + + media_id = models.IntegerField(_('media ID')) + artists = models.ManyToManyField('Artist', related_name='videos', verbose_name=_('artists'), blank=True) + + def __unicode__(self): + return u"Video" + + +class Location(models.Model): + """(Location description)""" + + location_id = models.IntegerField() + + def __unicode__(self): + return u"Location" diff --git a/app/festival/related.py b/app/festival/related.py new file mode 100644 index 00000000..5b1affbd --- /dev/null +++ b/app/festival/related.py @@ -0,0 +1,32 @@ +from django.core import exceptions +from django.db.models.fields.related import ForeignKey +from django.db.utils import ConnectionHandler, ConnectionRouter + +connections = ConnectionHandler() +router = ConnectionRouter() + + +class SpanningForeignKey(ForeignKey): + + def validate(self, value, model_instance): + if self.rel.parent_link: + return + # Call the grandparent rather than the parent to skip validation + super(ForeignKey, self).validate(value, model_instance) + if value is None: + return + + using = router.db_for_read(self.rel.to, instance=model_instance) + qs = self.rel.to._default_manager.using(using).filter( + **{self.rel.field_name: value} + ) + qs = qs.complex_filter(self.get_limit_choices_to()) + if not qs.exists(): + raise exceptions.ValidationError( + self.error_messages['invalid'], + code='invalid', + params={ + 'model': self.rel.to._meta.verbose_name, 'pk': value, + 'field': self.rel.field_name, 'value': value, + }, # 'pk' is included for backwards compatibility + ) diff --git a/app/festival/routers.py b/app/festival/routers.py new file mode 100644 index 00000000..6bde6a32 --- /dev/null +++ b/app/festival/routers.py @@ -0,0 +1,31 @@ + +class FestivalRouter(object): + """ + A router to control all database operations on models in festival + """ + + def db_for_read(self, model, **hints): + if model._meta.app_label == 'festival': + return 'default' + return None + + def db_for_write(self, model, **hints): + if model._meta.app_label == 'festival': + return 'default' + return None + + def allow_relation(self, obj1, obj2, **hints): + if obj1._meta.app_label == 'festival' or \ + obj2._meta.app_label == 'festival': + return True + return None + + # def allow_migrate(self, db, app_label, model=None, **hints): + # if app_label == 'festival': + # return db == 'default' + # return None + + def allow_migrate(self, db, app_label, model_name=None, **hints): + if 'target_db' in hints: + return db == hints['target_db'] + return True diff --git a/app/festival/static/festival/css/festival.css b/app/festival/static/festival/css/festival.css new file mode 100644 index 00000000..e69de29b diff --git a/app/festival/static/festival/js/festival.js b/app/festival/static/festival/js/festival.js new file mode 100644 index 00000000..e69de29b diff --git a/app/festival/static/festival/less/festival.less b/app/festival/static/festival/less/festival.less new file mode 100644 index 00000000..e69de29b diff --git a/app/festival/templates/festival/artist_detail.html b/app/festival/templates/festival/artist_detail.html new file mode 100644 index 00000000..a9b1bd21 --- /dev/null +++ b/app/festival/templates/festival/artist_detail.html @@ -0,0 +1,15 @@ +{% extends "base.html" %} +{% load i18n %} +{% load mezzanine_tags keyword_tags %} + +{% block main %} + +
+

{{ artist.name }}

+
+ +
+ {{ artist.bio|safe }} +
+ +{% endblock %} diff --git a/app/festival/templates/festival/artist_list.html b/app/festival/templates/festival/artist_list.html new file mode 100644 index 00000000..59248133 --- /dev/null +++ b/app/festival/templates/festival/artist_list.html @@ -0,0 +1,15 @@ +{% extends "base.html" %} +{% load i18n %} +{% load mezzanine_tags keyword_tags %} + +{% block main %} + +
+ +
+ +{% endblock %} diff --git a/app/festival/tests.py b/app/festival/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/app/festival/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/app/festival/urls.py b/app/festival/urls.py new file mode 100644 index 00000000..da5434c4 --- /dev/null +++ b/app/festival/urls.py @@ -0,0 +1,16 @@ +from __future__ import unicode_literals + +from django.conf.urls import patterns, include, url +from django.conf.urls.i18n import i18n_patterns +from django.contrib import admin + +from mezzanine.core.views import direct_to_template +from mezzanine.conf import settings + +from festival.views import * + +urlpatterns = patterns('', + url(r'^artists/$', ArtistListView.as_view(), name="festival-artists"), + url(r'^artists/(?P.*)/$', ArtistDetailView.as_view(), name="festival-artist-detail"), + +) diff --git a/app/festival/views.py b/app/festival/views.py new file mode 100644 index 00000000..53b72231 --- /dev/null +++ b/app/festival/views.py @@ -0,0 +1,26 @@ +from django.shortcuts import render +from django.views.generic import * +from django.views.generic.base import * + +from festival.models import * + + +class ArtistListView(ListView): + + model = Artist + template_name='festival/artist_list.html' + + def get_context_data(self, **kwargs): + context = super(ArtistListView, self).get_context_data(**kwargs) + return context + + +class ArtistDetailView(DetailView): + + model = Artist + template_name='festival/artist_detail.html' + context_object_name = 'artist' + + def get_context_data(self, **kwargs): + context = super(ArtistDetailView, self).get_context_data(**kwargs) + return context diff --git a/app/manifeste/__init__.py b/app/manifeste/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/app/manifeste/admin.py b/app/manifeste/admin.py deleted file mode 100644 index 8c38f3f3..00000000 --- a/app/manifeste/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/app/manifeste/migrations/__init__.py b/app/manifeste/migrations/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/app/manifeste/models.py b/app/manifeste/models.py deleted file mode 100644 index 71a83623..00000000 --- a/app/manifeste/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/app/manifeste/tests.py b/app/manifeste/tests.py deleted file mode 100644 index 7ce503c2..00000000 --- a/app/manifeste/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/app/manifeste/views.py b/app/manifeste/views.py deleted file mode 100644 index 91ea44a2..00000000 --- a/app/manifeste/views.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.shortcuts import render - -# Create your views here. diff --git a/app/migrations/__init__.py b/app/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/app/migrations/blog/0001_initial.py b/app/migrations/blog/0001_initial.py new file mode 100644 index 00000000..1124f8b4 --- /dev/null +++ b/app/migrations/blog/0001_initial.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import mezzanine.core.fields +import mezzanine.utils.models +from django.conf import settings + + +class Migration(migrations.Migration): + + dependencies = [ + ('sites', '0001_initial'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='BlogCategory', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('title', models.CharField(max_length=500, verbose_name='Title')), + ('slug', models.CharField(help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL', blank=True)), + ('site', models.ForeignKey(editable=False, to='sites.Site')), + ], + options={ + 'ordering': ('title',), + 'verbose_name': 'Blog Category', + 'verbose_name_plural': 'Blog Categories', + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='BlogPost', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('comments_count', models.IntegerField(default=0, editable=False)), + ('keywords_string', models.CharField(max_length=500, editable=False, blank=True)), + ('rating_count', models.IntegerField(default=0, editable=False)), + ('rating_sum', models.IntegerField(default=0, editable=False)), + ('rating_average', models.FloatField(default=0, editable=False)), + ('title', models.CharField(max_length=500, verbose_name='Title')), + ('slug', models.CharField(help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL', blank=True)), + ('_meta_title', models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True)), + ('description', models.TextField(verbose_name='Description', blank=True)), + ('gen_description', models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description')), + ('created', models.DateTimeField(null=True, editable=False)), + ('updated', models.DateTimeField(null=True, editable=False)), + ('status', models.IntegerField(default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status', choices=[(1, 'Draft'), (2, 'Published')])), + ('publish_date', models.DateTimeField(help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from', blank=True)), + ('expiry_date', models.DateTimeField(help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on', blank=True)), + ('short_url', models.URLField(null=True, blank=True)), + ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')), + ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')), + ('allow_comments', models.BooleanField(default=True, verbose_name='Allow comments')), + ('featured_image', mezzanine.core.fields.FileField(max_length=255, null=True, verbose_name='Featured Image', blank=True)), + ('categories', models.ManyToManyField(related_name='blogposts', verbose_name='Categories', to='blog.BlogCategory', blank=True)), + ('related_posts', models.ManyToManyField(related_name='related_posts_rel_+', verbose_name='Related posts', to='blog.BlogPost', blank=True)), + ('site', models.ForeignKey(editable=False, to='sites.Site')), + ('user', models.ForeignKey(related_name='blogposts', verbose_name='Author', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'ordering': ('-publish_date',), + 'verbose_name': 'Blog post', + 'verbose_name_plural': 'Blog posts', + }, + bases=(models.Model, mezzanine.utils.models.AdminThumbMixin), + ), + ] diff --git a/app/migrations/blog/0002_auto_20150527_1555.py b/app/migrations/blog/0002_auto_20150527_1555.py new file mode 100644 index 00000000..a5cb65cc --- /dev/null +++ b/app/migrations/blog/0002_auto_20150527_1555.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('blog', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='blogpost', + name='publish_date', + field=models.DateTimeField(help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from', db_index=True, blank=True), + ), + ] diff --git a/app/migrations/blog/0003_auto_20151223_1313.py b/app/migrations/blog/0003_auto_20151223_1313.py new file mode 100644 index 00000000..2d1da523 --- /dev/null +++ b/app/migrations/blog/0003_auto_20151223_1313.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import mezzanine.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('blog', '0002_auto_20150527_1555'), + ] + + operations = [ + migrations.AddField( + model_name='blogcategory', + name='title_en', + field=models.CharField(max_length=500, null=True, verbose_name='Title'), + ), + migrations.AddField( + model_name='blogcategory', + name='title_fr', + field=models.CharField(max_length=500, null=True, verbose_name='Title'), + ), + migrations.AddField( + model_name='blogpost', + name='_meta_title_en', + field=models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True), + ), + migrations.AddField( + model_name='blogpost', + name='_meta_title_fr', + field=models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True), + ), + migrations.AddField( + model_name='blogpost', + name='content_en', + field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), + ), + migrations.AddField( + model_name='blogpost', + name='content_fr', + field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), + ), + migrations.AddField( + model_name='blogpost', + name='description_en', + field=models.TextField(null=True, verbose_name='Description', blank=True), + ), + migrations.AddField( + model_name='blogpost', + name='description_fr', + field=models.TextField(null=True, verbose_name='Description', blank=True), + ), + migrations.AddField( + model_name='blogpost', + name='title_en', + field=models.CharField(max_length=500, null=True, verbose_name='Title'), + ), + migrations.AddField( + model_name='blogpost', + name='title_fr', + field=models.CharField(max_length=500, null=True, verbose_name='Title'), + ), + ] diff --git a/app/migrations/blog/__init__.py b/app/migrations/blog/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/app/migrations/conf/0001_initial.py b/app/migrations/conf/0001_initial.py new file mode 100644 index 00000000..ce02a03b --- /dev/null +++ b/app/migrations/conf/0001_initial.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('sites', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Setting', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('name', models.CharField(max_length=50)), + ('value', models.CharField(max_length=2000)), + ('site', models.ForeignKey(editable=False, to='sites.Site')), + ], + options={ + 'verbose_name': 'Setting', + 'verbose_name_plural': 'Settings', + }, + bases=(models.Model,), + ), + ] diff --git a/app/migrations/conf/0002_auto_20151223_1313.py b/app/migrations/conf/0002_auto_20151223_1313.py new file mode 100644 index 00000000..fb2bf3c3 --- /dev/null +++ b/app/migrations/conf/0002_auto_20151223_1313.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('conf', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='setting', + name='value_en', + field=models.CharField(max_length=2000, null=True), + ), + migrations.AddField( + model_name='setting', + name='value_fr', + field=models.CharField(max_length=2000, null=True), + ), + ] diff --git a/app/migrations/conf/__init__.py b/app/migrations/conf/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/app/migrations/forms/0001_initial.py b/app/migrations/forms/0001_initial.py new file mode 100644 index 00000000..fa1e791c --- /dev/null +++ b/app/migrations/forms/0001_initial.py @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import mezzanine.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('pages', '__first__'), + ] + + operations = [ + migrations.CreateModel( + name='Field', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('_order', models.IntegerField(null=True, verbose_name='Order')), + ('label', models.CharField(max_length=200, verbose_name='Label')), + ('field_type', models.IntegerField(verbose_name='Type', choices=[(1, 'Single line text'), (2, 'Multi line text'), (3, 'Email'), (13, 'Number'), (14, 'URL'), (4, 'Check box'), (5, 'Check boxes'), (6, 'Drop down'), (7, 'Multi select'), (8, 'Radio buttons'), (9, 'File upload'), (10, 'Date'), (11, 'Date/time'), (15, 'Date of birth'), (12, 'Hidden')])), + ('required', models.BooleanField(default=True, verbose_name='Required')), + ('visible', models.BooleanField(default=True, verbose_name='Visible')), + ('choices', models.CharField(help_text='Comma separated options where applicable. If an option itself contains commas, surround the option with `backticks`.', max_length=1000, verbose_name='Choices', blank=True)), + ('default', models.CharField(max_length=2000, verbose_name='Default value', blank=True)), + ('placeholder_text', models.CharField(verbose_name='Placeholder Text', max_length=100, editable=False, blank=True)), + ('help_text', models.CharField(max_length=100, verbose_name='Help text', blank=True)), + ], + options={ + 'ordering': ('_order',), + 'verbose_name': 'Field', + 'verbose_name_plural': 'Fields', + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='FieldEntry', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('field_id', models.IntegerField()), + ('value', models.CharField(max_length=2000, null=True)), + ], + options={ + 'verbose_name': 'Form field entry', + 'verbose_name_plural': 'Form field entries', + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='Form', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='pages.Page')), + ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')), + ('button_text', models.CharField(default='Submit', max_length=50, verbose_name='Button text')), + ('response', mezzanine.core.fields.RichTextField(verbose_name='Response')), + ('send_email', models.BooleanField(default=True, help_text='To send an email to the email address supplied in the form upon submission, check this box.', verbose_name='Send email to user')), + ('email_from', models.EmailField(help_text='The address the email will be sent from', max_length=75, verbose_name='From address', blank=True)), + ('email_copies', models.CharField(help_text='Provide a comma separated list of email addresses to be notified upon form submission. Leave blank to disable notifications.', max_length=200, verbose_name='Send email to others', blank=True)), + ('email_subject', models.CharField(max_length=200, verbose_name='Subject', blank=True)), + ('email_message', models.TextField(help_text='Emails sent based on the above options will contain each of the form fields entered. You can also enter a message here that will be included in the email.', verbose_name='Message', blank=True)), + ], + options={ + 'ordering': ('_order',), + 'verbose_name': 'Form', + 'verbose_name_plural': 'Forms', + }, + bases=('pages.page', models.Model), + ), + migrations.CreateModel( + name='FormEntry', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('entry_time', models.DateTimeField(verbose_name='Date/time')), + ('form', models.ForeignKey(related_name='entries', to='forms.Form')), + ], + options={ + 'verbose_name': 'Form entry', + 'verbose_name_plural': 'Form entries', + }, + bases=(models.Model,), + ), + migrations.AddField( + model_name='fieldentry', + name='entry', + field=models.ForeignKey(related_name='fields', to='forms.FormEntry'), + preserve_default=True, + ), + migrations.AddField( + model_name='field', + name='form', + field=models.ForeignKey(related_name='fields', to='forms.Form'), + preserve_default=True, + ), + ] diff --git a/app/migrations/forms/0002_auto_20141227_0224.py b/app/migrations/forms/0002_auto_20141227_0224.py new file mode 100644 index 00000000..8e8905e5 --- /dev/null +++ b/app/migrations/forms/0002_auto_20141227_0224.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import mezzanine.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('forms', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='field', + name='_order', + field=mezzanine.core.fields.OrderField(null=True, verbose_name='Order'), + preserve_default=True, + ), + ] diff --git a/app/migrations/forms/0003_emailfield.py b/app/migrations/forms/0003_emailfield.py new file mode 100644 index 00000000..9f826c6a --- /dev/null +++ b/app/migrations/forms/0003_emailfield.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import mezzanine.pages.managers + + +class Migration(migrations.Migration): + + dependencies = [ + ('forms', '0002_auto_20141227_0224'), + ] + + operations = [ + migrations.AlterField( + model_name='form', + name='email_from', + field=models.EmailField(help_text='The address the email will be sent from', max_length=254, verbose_name='From address', blank=True), + ), + ] diff --git a/app/migrations/forms/0004_auto_20150517_0510.py b/app/migrations/forms/0004_auto_20150517_0510.py new file mode 100644 index 00000000..b7cb5526 --- /dev/null +++ b/app/migrations/forms/0004_auto_20150517_0510.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('forms', '0003_emailfield'), + ] + + operations = [ + migrations.AlterField( + model_name='form', + name='button_text', + field=models.CharField(max_length=50, verbose_name='Button text', blank=True), + ), + ] diff --git a/app/migrations/forms/0005_auto_20151223_1313.py b/app/migrations/forms/0005_auto_20151223_1313.py new file mode 100644 index 00000000..852552ac --- /dev/null +++ b/app/migrations/forms/0005_auto_20151223_1313.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import mezzanine.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('forms', '0004_auto_20150517_0510'), + ] + + operations = [ + migrations.AddField( + model_name='field', + name='choices_en', + field=models.CharField(help_text='Comma separated options where applicable. If an option itself contains commas, surround the option with `backticks`.', max_length=1000, null=True, verbose_name='Choices', blank=True), + ), + migrations.AddField( + model_name='field', + name='choices_fr', + field=models.CharField(help_text='Comma separated options where applicable. If an option itself contains commas, surround the option with `backticks`.', max_length=1000, null=True, verbose_name='Choices', blank=True), + ), + migrations.AddField( + model_name='field', + name='default_en', + field=models.CharField(max_length=2000, null=True, verbose_name='Default value', blank=True), + ), + migrations.AddField( + model_name='field', + name='default_fr', + field=models.CharField(max_length=2000, null=True, verbose_name='Default value', blank=True), + ), + migrations.AddField( + model_name='field', + name='help_text_en', + field=models.CharField(max_length=100, null=True, verbose_name='Help text', blank=True), + ), + migrations.AddField( + model_name='field', + name='help_text_fr', + field=models.CharField(max_length=100, null=True, verbose_name='Help text', blank=True), + ), + migrations.AddField( + model_name='field', + name='label_en', + field=models.CharField(max_length=200, null=True, verbose_name='Label'), + ), + migrations.AddField( + model_name='field', + name='label_fr', + field=models.CharField(max_length=200, null=True, verbose_name='Label'), + ), + migrations.AddField( + model_name='field', + name='placeholder_text_en', + field=models.CharField(verbose_name='Placeholder Text', max_length=100, null=True, editable=False, blank=True), + ), + migrations.AddField( + model_name='field', + name='placeholder_text_fr', + field=models.CharField(verbose_name='Placeholder Text', max_length=100, null=True, editable=False, blank=True), + ), + migrations.AddField( + model_name='form', + name='button_text_en', + field=models.CharField(max_length=50, null=True, verbose_name='Button text', blank=True), + ), + migrations.AddField( + model_name='form', + name='button_text_fr', + field=models.CharField(max_length=50, null=True, verbose_name='Button text', blank=True), + ), + migrations.AddField( + model_name='form', + name='content_en', + field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), + ), + migrations.AddField( + model_name='form', + name='content_fr', + field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), + ), + migrations.AddField( + model_name='form', + name='email_message_en', + field=models.TextField(help_text='Emails sent based on the above options will contain each of the form fields entered. You can also enter a message here that will be included in the email.', null=True, verbose_name='Message', blank=True), + ), + migrations.AddField( + model_name='form', + name='email_message_fr', + field=models.TextField(help_text='Emails sent based on the above options will contain each of the form fields entered. You can also enter a message here that will be included in the email.', null=True, verbose_name='Message', blank=True), + ), + migrations.AddField( + model_name='form', + name='email_subject_en', + field=models.CharField(max_length=200, null=True, verbose_name='Subject', blank=True), + ), + migrations.AddField( + model_name='form', + name='email_subject_fr', + field=models.CharField(max_length=200, null=True, verbose_name='Subject', blank=True), + ), + migrations.AddField( + model_name='form', + name='response_en', + field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Response'), + ), + migrations.AddField( + model_name='form', + name='response_fr', + field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Response'), + ), + ] diff --git a/app/migrations/forms/__init__.py b/app/migrations/forms/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/app/migrations/galleries/0001_initial.py b/app/migrations/galleries/0001_initial.py new file mode 100644 index 00000000..11f1937e --- /dev/null +++ b/app/migrations/galleries/0001_initial.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import mezzanine.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('pages', '__first__'), + ] + + operations = [ + migrations.CreateModel( + name='Gallery', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='pages.Page')), + ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')), + ('zip_import', models.FileField(help_text="Upload a zip file containing images, and they'll be imported into this gallery.", upload_to='galleries', verbose_name='Zip import', blank=True)), + ], + options={ + 'ordering': ('_order',), + 'verbose_name': 'Gallery', + 'verbose_name_plural': 'Galleries', + }, + bases=('pages.page', models.Model), + ), + migrations.CreateModel( + name='GalleryImage', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('_order', models.IntegerField(null=True, verbose_name='Order')), + ('file', mezzanine.core.fields.FileField(max_length=200, verbose_name='File')), + ('description', models.CharField(max_length=1000, verbose_name='Description', blank=True)), + ('gallery', models.ForeignKey(related_name='images', to='galleries.Gallery')), + ], + options={ + 'ordering': ('_order',), + 'verbose_name': 'Image', + 'verbose_name_plural': 'Images', + }, + bases=(models.Model,), + ), + ] diff --git a/app/migrations/galleries/0002_auto_20141227_0224.py b/app/migrations/galleries/0002_auto_20141227_0224.py new file mode 100644 index 00000000..89bf6338 --- /dev/null +++ b/app/migrations/galleries/0002_auto_20141227_0224.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import mezzanine.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('galleries', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='galleryimage', + name='_order', + field=mezzanine.core.fields.OrderField(null=True, verbose_name='Order'), + preserve_default=True, + ), + ] diff --git a/app/migrations/galleries/0003_auto_20151223_1313.py b/app/migrations/galleries/0003_auto_20151223_1313.py new file mode 100644 index 00000000..2a618524 --- /dev/null +++ b/app/migrations/galleries/0003_auto_20151223_1313.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import mezzanine.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('galleries', '0002_auto_20141227_0224'), + ] + + operations = [ + migrations.AddField( + model_name='gallery', + name='content_en', + field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), + ), + migrations.AddField( + model_name='gallery', + name='content_fr', + field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), + ), + migrations.AddField( + model_name='galleryimage', + name='description_en', + field=models.CharField(max_length=1000, null=True, verbose_name='Description', blank=True), + ), + migrations.AddField( + model_name='galleryimage', + name='description_fr', + field=models.CharField(max_length=1000, null=True, verbose_name='Description', blank=True), + ), + ] diff --git a/app/migrations/galleries/__init__.py b/app/migrations/galleries/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/app/migrations/pages/0001_initial.py b/app/migrations/pages/0001_initial.py new file mode 100644 index 00000000..4429c29b --- /dev/null +++ b/app/migrations/pages/0001_initial.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import mezzanine.core.fields +import mezzanine.pages.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('sites', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Page', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('keywords_string', models.CharField(max_length=500, editable=False, blank=True)), + ('title', models.CharField(max_length=500, verbose_name='Title')), + ('slug', models.CharField(help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL', blank=True)), + ('_meta_title', models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True)), + ('description', models.TextField(verbose_name='Description', blank=True)), + ('gen_description', models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description')), + ('created', models.DateTimeField(null=True, editable=False)), + ('updated', models.DateTimeField(null=True, editable=False)), + ('status', models.IntegerField(default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status', choices=[(1, 'Draft'), (2, 'Published')])), + ('publish_date', models.DateTimeField(help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from', blank=True)), + ('expiry_date', models.DateTimeField(help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on', blank=True)), + ('short_url', models.URLField(null=True, blank=True)), + ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')), + ('_order', models.IntegerField(null=True, verbose_name='Order')), + ('in_menus', mezzanine.pages.fields.MenusField(default=(1, 2, 3), choices=[(1, 'Top navigation bar'), (2, 'Left-hand tree'), (3, 'Footer')], max_length=100, blank=True, null=True, verbose_name='Show in menus')), + ('titles', models.CharField(max_length=1000, null=True, editable=False)), + ('content_model', models.CharField(max_length=50, null=True, editable=False)), + ('login_required', models.BooleanField(default=False, help_text='If checked, only logged in users can view this page', verbose_name='Login required')), + ], + options={ + 'ordering': ('titles',), + 'verbose_name': 'Page', + 'verbose_name_plural': 'Pages', + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='Link', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='pages.Page')), + ], + options={ + 'ordering': ('_order',), + 'verbose_name': 'Link', + 'verbose_name_plural': 'Links', + }, + bases=('pages.page',), + ), + migrations.CreateModel( + name='RichTextPage', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='pages.Page')), + ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')), + ], + options={ + 'ordering': ('_order',), + 'verbose_name': 'Rich text page', + 'verbose_name_plural': 'Rich text pages', + }, + bases=('pages.page', models.Model), + ), + migrations.AddField( + model_name='page', + name='parent', + field=models.ForeignKey(related_name='children', blank=True, to='pages.Page', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='page', + name='site', + field=models.ForeignKey(editable=False, to='sites.Site'), + preserve_default=True, + ), + ] diff --git a/app/migrations/pages/0002_auto_20141227_0224.py b/app/migrations/pages/0002_auto_20141227_0224.py new file mode 100644 index 00000000..85bddb26 --- /dev/null +++ b/app/migrations/pages/0002_auto_20141227_0224.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import mezzanine.pages.fields +import mezzanine.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('pages', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='page', + name='_order', + field=mezzanine.core.fields.OrderField(null=True, verbose_name='Order'), + preserve_default=True, + ), + migrations.AlterField( + model_name='page', + name='in_menus', + field=mezzanine.pages.fields.MenusField(max_length=100, null=True, verbose_name='Show in menus', blank=True), + preserve_default=True, + ), + ] diff --git a/app/migrations/pages/0003_auto_20150527_1555.py b/app/migrations/pages/0003_auto_20150527_1555.py new file mode 100644 index 00000000..b0682fee --- /dev/null +++ b/app/migrations/pages/0003_auto_20150527_1555.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('pages', '0002_auto_20141227_0224'), + ] + + operations = [ + migrations.AlterField( + model_name='page', + name='publish_date', + field=models.DateTimeField(help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from', db_index=True, blank=True), + ), + ] diff --git a/app/migrations/pages/0004_auto_20151223_1313.py b/app/migrations/pages/0004_auto_20151223_1313.py new file mode 100644 index 00000000..6f0ca5ec --- /dev/null +++ b/app/migrations/pages/0004_auto_20151223_1313.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import mezzanine.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('pages', '0003_auto_20150527_1555'), + ] + + operations = [ + migrations.AddField( + model_name='page', + name='_meta_title_en', + field=models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True), + ), + migrations.AddField( + model_name='page', + name='_meta_title_fr', + field=models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True), + ), + migrations.AddField( + model_name='page', + name='description_en', + field=models.TextField(null=True, verbose_name='Description', blank=True), + ), + migrations.AddField( + model_name='page', + name='description_fr', + field=models.TextField(null=True, verbose_name='Description', blank=True), + ), + migrations.AddField( + model_name='page', + name='title_en', + field=models.CharField(max_length=500, null=True, verbose_name='Title'), + ), + migrations.AddField( + model_name='page', + name='title_fr', + field=models.CharField(max_length=500, null=True, verbose_name='Title'), + ), + migrations.AddField( + model_name='page', + name='titles_en', + field=models.CharField(max_length=1000, null=True, editable=False), + ), + migrations.AddField( + model_name='page', + name='titles_fr', + field=models.CharField(max_length=1000, null=True, editable=False), + ), + migrations.AddField( + model_name='richtextpage', + name='content_en', + field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), + ), + migrations.AddField( + model_name='richtextpage', + name='content_fr', + field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), + ), + ] diff --git a/app/migrations/pages/__init__.py b/app/migrations/pages/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/app/sandbox/local_settings.py b/app/sandbox/local_settings.py index 8c113132..2f09b566 100644 --- a/app/sandbox/local_settings.py +++ b/app/sandbox/local_settings.py @@ -6,16 +6,25 @@ DEBUG = True SECRET_KEY = "+3b01&_6_m@@yb4f06$s0zno8vkybh81nbuj_q(xzk+xeih1+s" NEVERCACHE_KEY = "l11tr%#!uc@+%$51(&+%=&z6h9yrw42(jpcj$3_&6evtu6hl%z" -DATABASE_ROUTERS = ['eve.routers.EveRouter', ] +# DATABASE_ROUTERS = ['eve.routers.EveRouter', 'festival.routers.FestivalRouter',] +DATABASE_ROUTERS = ['eve.routers.EveRouter',] DATABASES = { + # 'default': { + # 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + # 'USER': os.environ.get('DB_ENV_MYSQL_USER'), # Not used with sqlite3. + # 'PASSWORD': os.environ.get('DB_ENV_MYSQL_PASSWORD'), # Not used with sqlite3. + # 'NAME': os.environ.get('DB_ENV_MYSQL_DATABASE'), + # 'HOST': 'db', # Set to empty string for localhost. Not used with sqlite3. + # 'PORT': '3306', # Set to empty string for default. Not used with sqlite3. + # }, 'default': { - 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. - 'USER': os.environ.get('DB_ENV_MYSQL_USER'), # Not used with sqlite3. - 'PASSWORD': os.environ.get('DB_ENV_MYSQL_PASSWORD'), # Not used with sqlite3. - 'NAME': os.environ.get('DB_ENV_MYSQL_DATABASE'), + 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + 'USER': 'postgres', # Not used with sqlite3. + 'PASSWORD': 'mysecretpassword', # Not used with sqlite3. + 'NAME': 'manifeste', 'HOST': 'db', # Set to empty string for localhost. Not used with sqlite3. - 'PORT': '3306', # Set to empty string for default. Not used with sqlite3. + 'PORT': '5432', # Set to empty string for default. Not used with sqlite3. }, 'eve': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', diff --git a/app/sandbox/middleware.py b/app/sandbox/middleware.py new file mode 100644 index 00000000..43a158a5 --- /dev/null +++ b/app/sandbox/middleware.py @@ -0,0 +1,22 @@ +from django.core.exceptions import MiddlewareNotUsed +from django.conf import settings +from django.core.management import call_command + + +class StartupMiddleware(object): + + def __init__(self): + up = False + print 'check..................................' + while not up: + try: + # # The following db settings name is django 1.2. django < 1.2 will use settings.DATABASE_NAME + # if settings.DATABASES['default']['NAME'] == ':memory:': + call_command('syncdb', interactive=False) + call_command('collectstatic', interactive=False) + up = True + except: + print 'waiting...' + time.sleep(1) + + raise MiddlewareNotUsed('Startup complete') diff --git a/app/sandbox/migrations/__init__.py b/app/sandbox/migrations/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/app/sandbox/migrations/blog/0001_initial.py b/app/sandbox/migrations/blog/0001_initial.py deleted file mode 100644 index 1124f8b4..00000000 --- a/app/sandbox/migrations/blog/0001_initial.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import mezzanine.core.fields -import mezzanine.utils.models -from django.conf import settings - - -class Migration(migrations.Migration): - - dependencies = [ - ('sites', '0001_initial'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name='BlogCategory', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('title', models.CharField(max_length=500, verbose_name='Title')), - ('slug', models.CharField(help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL', blank=True)), - ('site', models.ForeignKey(editable=False, to='sites.Site')), - ], - options={ - 'ordering': ('title',), - 'verbose_name': 'Blog Category', - 'verbose_name_plural': 'Blog Categories', - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='BlogPost', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('comments_count', models.IntegerField(default=0, editable=False)), - ('keywords_string', models.CharField(max_length=500, editable=False, blank=True)), - ('rating_count', models.IntegerField(default=0, editable=False)), - ('rating_sum', models.IntegerField(default=0, editable=False)), - ('rating_average', models.FloatField(default=0, editable=False)), - ('title', models.CharField(max_length=500, verbose_name='Title')), - ('slug', models.CharField(help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL', blank=True)), - ('_meta_title', models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True)), - ('description', models.TextField(verbose_name='Description', blank=True)), - ('gen_description', models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description')), - ('created', models.DateTimeField(null=True, editable=False)), - ('updated', models.DateTimeField(null=True, editable=False)), - ('status', models.IntegerField(default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status', choices=[(1, 'Draft'), (2, 'Published')])), - ('publish_date', models.DateTimeField(help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from', blank=True)), - ('expiry_date', models.DateTimeField(help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on', blank=True)), - ('short_url', models.URLField(null=True, blank=True)), - ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')), - ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')), - ('allow_comments', models.BooleanField(default=True, verbose_name='Allow comments')), - ('featured_image', mezzanine.core.fields.FileField(max_length=255, null=True, verbose_name='Featured Image', blank=True)), - ('categories', models.ManyToManyField(related_name='blogposts', verbose_name='Categories', to='blog.BlogCategory', blank=True)), - ('related_posts', models.ManyToManyField(related_name='related_posts_rel_+', verbose_name='Related posts', to='blog.BlogPost', blank=True)), - ('site', models.ForeignKey(editable=False, to='sites.Site')), - ('user', models.ForeignKey(related_name='blogposts', verbose_name='Author', to=settings.AUTH_USER_MODEL)), - ], - options={ - 'ordering': ('-publish_date',), - 'verbose_name': 'Blog post', - 'verbose_name_plural': 'Blog posts', - }, - bases=(models.Model, mezzanine.utils.models.AdminThumbMixin), - ), - ] diff --git a/app/sandbox/migrations/blog/0002_auto_20150527_1555.py b/app/sandbox/migrations/blog/0002_auto_20150527_1555.py deleted file mode 100644 index a5cb65cc..00000000 --- a/app/sandbox/migrations/blog/0002_auto_20150527_1555.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('blog', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='blogpost', - name='publish_date', - field=models.DateTimeField(help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from', db_index=True, blank=True), - ), - ] diff --git a/app/sandbox/migrations/blog/0003_auto_20151223_1313.py b/app/sandbox/migrations/blog/0003_auto_20151223_1313.py deleted file mode 100644 index 2d1da523..00000000 --- a/app/sandbox/migrations/blog/0003_auto_20151223_1313.py +++ /dev/null @@ -1,65 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -import mezzanine.core.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('blog', '0002_auto_20150527_1555'), - ] - - operations = [ - migrations.AddField( - model_name='blogcategory', - name='title_en', - field=models.CharField(max_length=500, null=True, verbose_name='Title'), - ), - migrations.AddField( - model_name='blogcategory', - name='title_fr', - field=models.CharField(max_length=500, null=True, verbose_name='Title'), - ), - migrations.AddField( - model_name='blogpost', - name='_meta_title_en', - field=models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True), - ), - migrations.AddField( - model_name='blogpost', - name='_meta_title_fr', - field=models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True), - ), - migrations.AddField( - model_name='blogpost', - name='content_en', - field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), - ), - migrations.AddField( - model_name='blogpost', - name='content_fr', - field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), - ), - migrations.AddField( - model_name='blogpost', - name='description_en', - field=models.TextField(null=True, verbose_name='Description', blank=True), - ), - migrations.AddField( - model_name='blogpost', - name='description_fr', - field=models.TextField(null=True, verbose_name='Description', blank=True), - ), - migrations.AddField( - model_name='blogpost', - name='title_en', - field=models.CharField(max_length=500, null=True, verbose_name='Title'), - ), - migrations.AddField( - model_name='blogpost', - name='title_fr', - field=models.CharField(max_length=500, null=True, verbose_name='Title'), - ), - ] diff --git a/app/sandbox/migrations/blog/__init__.py b/app/sandbox/migrations/blog/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/app/sandbox/migrations/conf/0001_initial.py b/app/sandbox/migrations/conf/0001_initial.py deleted file mode 100644 index ce02a03b..00000000 --- a/app/sandbox/migrations/conf/0001_initial.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('sites', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Setting', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('name', models.CharField(max_length=50)), - ('value', models.CharField(max_length=2000)), - ('site', models.ForeignKey(editable=False, to='sites.Site')), - ], - options={ - 'verbose_name': 'Setting', - 'verbose_name_plural': 'Settings', - }, - bases=(models.Model,), - ), - ] diff --git a/app/sandbox/migrations/conf/0002_auto_20151223_1313.py b/app/sandbox/migrations/conf/0002_auto_20151223_1313.py deleted file mode 100644 index fb2bf3c3..00000000 --- a/app/sandbox/migrations/conf/0002_auto_20151223_1313.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('conf', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='setting', - name='value_en', - field=models.CharField(max_length=2000, null=True), - ), - migrations.AddField( - model_name='setting', - name='value_fr', - field=models.CharField(max_length=2000, null=True), - ), - ] diff --git a/app/sandbox/migrations/conf/__init__.py b/app/sandbox/migrations/conf/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/app/sandbox/migrations/forms/0001_initial.py b/app/sandbox/migrations/forms/0001_initial.py deleted file mode 100644 index fa1e791c..00000000 --- a/app/sandbox/migrations/forms/0001_initial.py +++ /dev/null @@ -1,94 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import mezzanine.core.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('pages', '__first__'), - ] - - operations = [ - migrations.CreateModel( - name='Field', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('_order', models.IntegerField(null=True, verbose_name='Order')), - ('label', models.CharField(max_length=200, verbose_name='Label')), - ('field_type', models.IntegerField(verbose_name='Type', choices=[(1, 'Single line text'), (2, 'Multi line text'), (3, 'Email'), (13, 'Number'), (14, 'URL'), (4, 'Check box'), (5, 'Check boxes'), (6, 'Drop down'), (7, 'Multi select'), (8, 'Radio buttons'), (9, 'File upload'), (10, 'Date'), (11, 'Date/time'), (15, 'Date of birth'), (12, 'Hidden')])), - ('required', models.BooleanField(default=True, verbose_name='Required')), - ('visible', models.BooleanField(default=True, verbose_name='Visible')), - ('choices', models.CharField(help_text='Comma separated options where applicable. If an option itself contains commas, surround the option with `backticks`.', max_length=1000, verbose_name='Choices', blank=True)), - ('default', models.CharField(max_length=2000, verbose_name='Default value', blank=True)), - ('placeholder_text', models.CharField(verbose_name='Placeholder Text', max_length=100, editable=False, blank=True)), - ('help_text', models.CharField(max_length=100, verbose_name='Help text', blank=True)), - ], - options={ - 'ordering': ('_order',), - 'verbose_name': 'Field', - 'verbose_name_plural': 'Fields', - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='FieldEntry', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('field_id', models.IntegerField()), - ('value', models.CharField(max_length=2000, null=True)), - ], - options={ - 'verbose_name': 'Form field entry', - 'verbose_name_plural': 'Form field entries', - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='Form', - fields=[ - ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='pages.Page')), - ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')), - ('button_text', models.CharField(default='Submit', max_length=50, verbose_name='Button text')), - ('response', mezzanine.core.fields.RichTextField(verbose_name='Response')), - ('send_email', models.BooleanField(default=True, help_text='To send an email to the email address supplied in the form upon submission, check this box.', verbose_name='Send email to user')), - ('email_from', models.EmailField(help_text='The address the email will be sent from', max_length=75, verbose_name='From address', blank=True)), - ('email_copies', models.CharField(help_text='Provide a comma separated list of email addresses to be notified upon form submission. Leave blank to disable notifications.', max_length=200, verbose_name='Send email to others', blank=True)), - ('email_subject', models.CharField(max_length=200, verbose_name='Subject', blank=True)), - ('email_message', models.TextField(help_text='Emails sent based on the above options will contain each of the form fields entered. You can also enter a message here that will be included in the email.', verbose_name='Message', blank=True)), - ], - options={ - 'ordering': ('_order',), - 'verbose_name': 'Form', - 'verbose_name_plural': 'Forms', - }, - bases=('pages.page', models.Model), - ), - migrations.CreateModel( - name='FormEntry', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('entry_time', models.DateTimeField(verbose_name='Date/time')), - ('form', models.ForeignKey(related_name='entries', to='forms.Form')), - ], - options={ - 'verbose_name': 'Form entry', - 'verbose_name_plural': 'Form entries', - }, - bases=(models.Model,), - ), - migrations.AddField( - model_name='fieldentry', - name='entry', - field=models.ForeignKey(related_name='fields', to='forms.FormEntry'), - preserve_default=True, - ), - migrations.AddField( - model_name='field', - name='form', - field=models.ForeignKey(related_name='fields', to='forms.Form'), - preserve_default=True, - ), - ] diff --git a/app/sandbox/migrations/forms/0002_auto_20141227_0224.py b/app/sandbox/migrations/forms/0002_auto_20141227_0224.py deleted file mode 100644 index 8e8905e5..00000000 --- a/app/sandbox/migrations/forms/0002_auto_20141227_0224.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import mezzanine.core.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('forms', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='field', - name='_order', - field=mezzanine.core.fields.OrderField(null=True, verbose_name='Order'), - preserve_default=True, - ), - ] diff --git a/app/sandbox/migrations/forms/0003_emailfield.py b/app/sandbox/migrations/forms/0003_emailfield.py deleted file mode 100644 index 9f826c6a..00000000 --- a/app/sandbox/migrations/forms/0003_emailfield.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import mezzanine.pages.managers - - -class Migration(migrations.Migration): - - dependencies = [ - ('forms', '0002_auto_20141227_0224'), - ] - - operations = [ - migrations.AlterField( - model_name='form', - name='email_from', - field=models.EmailField(help_text='The address the email will be sent from', max_length=254, verbose_name='From address', blank=True), - ), - ] diff --git a/app/sandbox/migrations/forms/0004_auto_20150517_0510.py b/app/sandbox/migrations/forms/0004_auto_20150517_0510.py deleted file mode 100644 index b7cb5526..00000000 --- a/app/sandbox/migrations/forms/0004_auto_20150517_0510.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('forms', '0003_emailfield'), - ] - - operations = [ - migrations.AlterField( - model_name='form', - name='button_text', - field=models.CharField(max_length=50, verbose_name='Button text', blank=True), - ), - ] diff --git a/app/sandbox/migrations/forms/0005_auto_20151223_1313.py b/app/sandbox/migrations/forms/0005_auto_20151223_1313.py deleted file mode 100644 index 852552ac..00000000 --- a/app/sandbox/migrations/forms/0005_auto_20151223_1313.py +++ /dev/null @@ -1,115 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -import mezzanine.core.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('forms', '0004_auto_20150517_0510'), - ] - - operations = [ - migrations.AddField( - model_name='field', - name='choices_en', - field=models.CharField(help_text='Comma separated options where applicable. If an option itself contains commas, surround the option with `backticks`.', max_length=1000, null=True, verbose_name='Choices', blank=True), - ), - migrations.AddField( - model_name='field', - name='choices_fr', - field=models.CharField(help_text='Comma separated options where applicable. If an option itself contains commas, surround the option with `backticks`.', max_length=1000, null=True, verbose_name='Choices', blank=True), - ), - migrations.AddField( - model_name='field', - name='default_en', - field=models.CharField(max_length=2000, null=True, verbose_name='Default value', blank=True), - ), - migrations.AddField( - model_name='field', - name='default_fr', - field=models.CharField(max_length=2000, null=True, verbose_name='Default value', blank=True), - ), - migrations.AddField( - model_name='field', - name='help_text_en', - field=models.CharField(max_length=100, null=True, verbose_name='Help text', blank=True), - ), - migrations.AddField( - model_name='field', - name='help_text_fr', - field=models.CharField(max_length=100, null=True, verbose_name='Help text', blank=True), - ), - migrations.AddField( - model_name='field', - name='label_en', - field=models.CharField(max_length=200, null=True, verbose_name='Label'), - ), - migrations.AddField( - model_name='field', - name='label_fr', - field=models.CharField(max_length=200, null=True, verbose_name='Label'), - ), - migrations.AddField( - model_name='field', - name='placeholder_text_en', - field=models.CharField(verbose_name='Placeholder Text', max_length=100, null=True, editable=False, blank=True), - ), - migrations.AddField( - model_name='field', - name='placeholder_text_fr', - field=models.CharField(verbose_name='Placeholder Text', max_length=100, null=True, editable=False, blank=True), - ), - migrations.AddField( - model_name='form', - name='button_text_en', - field=models.CharField(max_length=50, null=True, verbose_name='Button text', blank=True), - ), - migrations.AddField( - model_name='form', - name='button_text_fr', - field=models.CharField(max_length=50, null=True, verbose_name='Button text', blank=True), - ), - migrations.AddField( - model_name='form', - name='content_en', - field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), - ), - migrations.AddField( - model_name='form', - name='content_fr', - field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), - ), - migrations.AddField( - model_name='form', - name='email_message_en', - field=models.TextField(help_text='Emails sent based on the above options will contain each of the form fields entered. You can also enter a message here that will be included in the email.', null=True, verbose_name='Message', blank=True), - ), - migrations.AddField( - model_name='form', - name='email_message_fr', - field=models.TextField(help_text='Emails sent based on the above options will contain each of the form fields entered. You can also enter a message here that will be included in the email.', null=True, verbose_name='Message', blank=True), - ), - migrations.AddField( - model_name='form', - name='email_subject_en', - field=models.CharField(max_length=200, null=True, verbose_name='Subject', blank=True), - ), - migrations.AddField( - model_name='form', - name='email_subject_fr', - field=models.CharField(max_length=200, null=True, verbose_name='Subject', blank=True), - ), - migrations.AddField( - model_name='form', - name='response_en', - field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Response'), - ), - migrations.AddField( - model_name='form', - name='response_fr', - field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Response'), - ), - ] diff --git a/app/sandbox/migrations/forms/__init__.py b/app/sandbox/migrations/forms/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/app/sandbox/migrations/galleries/0001_initial.py b/app/sandbox/migrations/galleries/0001_initial.py deleted file mode 100644 index 11f1937e..00000000 --- a/app/sandbox/migrations/galleries/0001_initial.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import mezzanine.core.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('pages', '__first__'), - ] - - operations = [ - migrations.CreateModel( - name='Gallery', - fields=[ - ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='pages.Page')), - ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')), - ('zip_import', models.FileField(help_text="Upload a zip file containing images, and they'll be imported into this gallery.", upload_to='galleries', verbose_name='Zip import', blank=True)), - ], - options={ - 'ordering': ('_order',), - 'verbose_name': 'Gallery', - 'verbose_name_plural': 'Galleries', - }, - bases=('pages.page', models.Model), - ), - migrations.CreateModel( - name='GalleryImage', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('_order', models.IntegerField(null=True, verbose_name='Order')), - ('file', mezzanine.core.fields.FileField(max_length=200, verbose_name='File')), - ('description', models.CharField(max_length=1000, verbose_name='Description', blank=True)), - ('gallery', models.ForeignKey(related_name='images', to='galleries.Gallery')), - ], - options={ - 'ordering': ('_order',), - 'verbose_name': 'Image', - 'verbose_name_plural': 'Images', - }, - bases=(models.Model,), - ), - ] diff --git a/app/sandbox/migrations/galleries/0002_auto_20141227_0224.py b/app/sandbox/migrations/galleries/0002_auto_20141227_0224.py deleted file mode 100644 index 89bf6338..00000000 --- a/app/sandbox/migrations/galleries/0002_auto_20141227_0224.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import mezzanine.core.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('galleries', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='galleryimage', - name='_order', - field=mezzanine.core.fields.OrderField(null=True, verbose_name='Order'), - preserve_default=True, - ), - ] diff --git a/app/sandbox/migrations/galleries/0003_auto_20151223_1313.py b/app/sandbox/migrations/galleries/0003_auto_20151223_1313.py deleted file mode 100644 index 2a618524..00000000 --- a/app/sandbox/migrations/galleries/0003_auto_20151223_1313.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -import mezzanine.core.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('galleries', '0002_auto_20141227_0224'), - ] - - operations = [ - migrations.AddField( - model_name='gallery', - name='content_en', - field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), - ), - migrations.AddField( - model_name='gallery', - name='content_fr', - field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), - ), - migrations.AddField( - model_name='galleryimage', - name='description_en', - field=models.CharField(max_length=1000, null=True, verbose_name='Description', blank=True), - ), - migrations.AddField( - model_name='galleryimage', - name='description_fr', - field=models.CharField(max_length=1000, null=True, verbose_name='Description', blank=True), - ), - ] diff --git a/app/sandbox/migrations/galleries/__init__.py b/app/sandbox/migrations/galleries/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/app/sandbox/migrations/pages/0001_initial.py b/app/sandbox/migrations/pages/0001_initial.py deleted file mode 100644 index 4429c29b..00000000 --- a/app/sandbox/migrations/pages/0001_initial.py +++ /dev/null @@ -1,83 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import mezzanine.core.fields -import mezzanine.pages.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('sites', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Page', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('keywords_string', models.CharField(max_length=500, editable=False, blank=True)), - ('title', models.CharField(max_length=500, verbose_name='Title')), - ('slug', models.CharField(help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL', blank=True)), - ('_meta_title', models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True)), - ('description', models.TextField(verbose_name='Description', blank=True)), - ('gen_description', models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description')), - ('created', models.DateTimeField(null=True, editable=False)), - ('updated', models.DateTimeField(null=True, editable=False)), - ('status', models.IntegerField(default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status', choices=[(1, 'Draft'), (2, 'Published')])), - ('publish_date', models.DateTimeField(help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from', blank=True)), - ('expiry_date', models.DateTimeField(help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on', blank=True)), - ('short_url', models.URLField(null=True, blank=True)), - ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')), - ('_order', models.IntegerField(null=True, verbose_name='Order')), - ('in_menus', mezzanine.pages.fields.MenusField(default=(1, 2, 3), choices=[(1, 'Top navigation bar'), (2, 'Left-hand tree'), (3, 'Footer')], max_length=100, blank=True, null=True, verbose_name='Show in menus')), - ('titles', models.CharField(max_length=1000, null=True, editable=False)), - ('content_model', models.CharField(max_length=50, null=True, editable=False)), - ('login_required', models.BooleanField(default=False, help_text='If checked, only logged in users can view this page', verbose_name='Login required')), - ], - options={ - 'ordering': ('titles',), - 'verbose_name': 'Page', - 'verbose_name_plural': 'Pages', - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='Link', - fields=[ - ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='pages.Page')), - ], - options={ - 'ordering': ('_order',), - 'verbose_name': 'Link', - 'verbose_name_plural': 'Links', - }, - bases=('pages.page',), - ), - migrations.CreateModel( - name='RichTextPage', - fields=[ - ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='pages.Page')), - ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')), - ], - options={ - 'ordering': ('_order',), - 'verbose_name': 'Rich text page', - 'verbose_name_plural': 'Rich text pages', - }, - bases=('pages.page', models.Model), - ), - migrations.AddField( - model_name='page', - name='parent', - field=models.ForeignKey(related_name='children', blank=True, to='pages.Page', null=True), - preserve_default=True, - ), - migrations.AddField( - model_name='page', - name='site', - field=models.ForeignKey(editable=False, to='sites.Site'), - preserve_default=True, - ), - ] diff --git a/app/sandbox/migrations/pages/0002_auto_20141227_0224.py b/app/sandbox/migrations/pages/0002_auto_20141227_0224.py deleted file mode 100644 index 85bddb26..00000000 --- a/app/sandbox/migrations/pages/0002_auto_20141227_0224.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import mezzanine.pages.fields -import mezzanine.core.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('pages', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='page', - name='_order', - field=mezzanine.core.fields.OrderField(null=True, verbose_name='Order'), - preserve_default=True, - ), - migrations.AlterField( - model_name='page', - name='in_menus', - field=mezzanine.pages.fields.MenusField(max_length=100, null=True, verbose_name='Show in menus', blank=True), - preserve_default=True, - ), - ] diff --git a/app/sandbox/migrations/pages/0003_auto_20150527_1555.py b/app/sandbox/migrations/pages/0003_auto_20150527_1555.py deleted file mode 100644 index b0682fee..00000000 --- a/app/sandbox/migrations/pages/0003_auto_20150527_1555.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('pages', '0002_auto_20141227_0224'), - ] - - operations = [ - migrations.AlterField( - model_name='page', - name='publish_date', - field=models.DateTimeField(help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from', db_index=True, blank=True), - ), - ] diff --git a/app/sandbox/migrations/pages/0004_auto_20151223_1313.py b/app/sandbox/migrations/pages/0004_auto_20151223_1313.py deleted file mode 100644 index 6f0ca5ec..00000000 --- a/app/sandbox/migrations/pages/0004_auto_20151223_1313.py +++ /dev/null @@ -1,65 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -import mezzanine.core.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('pages', '0003_auto_20150527_1555'), - ] - - operations = [ - migrations.AddField( - model_name='page', - name='_meta_title_en', - field=models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True), - ), - migrations.AddField( - model_name='page', - name='_meta_title_fr', - field=models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True), - ), - migrations.AddField( - model_name='page', - name='description_en', - field=models.TextField(null=True, verbose_name='Description', blank=True), - ), - migrations.AddField( - model_name='page', - name='description_fr', - field=models.TextField(null=True, verbose_name='Description', blank=True), - ), - migrations.AddField( - model_name='page', - name='title_en', - field=models.CharField(max_length=500, null=True, verbose_name='Title'), - ), - migrations.AddField( - model_name='page', - name='title_fr', - field=models.CharField(max_length=500, null=True, verbose_name='Title'), - ), - migrations.AddField( - model_name='page', - name='titles_en', - field=models.CharField(max_length=1000, null=True, editable=False), - ), - migrations.AddField( - model_name='page', - name='titles_fr', - field=models.CharField(max_length=1000, null=True, editable=False), - ), - migrations.AddField( - model_name='richtextpage', - name='content_en', - field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), - ), - migrations.AddField( - model_name='richtextpage', - name='content_fr', - field=mezzanine.core.fields.RichTextField(null=True, verbose_name='Content'), - ), - ] diff --git a/app/sandbox/migrations/pages/__init__.py b/app/sandbox/migrations/pages/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/app/sandbox/settings.py b/app/sandbox/settings.py index ba1352dc..0fbb613b 100644 --- a/app/sandbox/settings.py +++ b/app/sandbox/settings.py @@ -214,16 +214,17 @@ INSTALLED_APPS = ( "mezzanine.twitter", "mezzanine.accounts", # "mezzanine.mobile", - "eve", + # "eve", + "festival", ) # Add Migration Module path see : https://github.com/stephenmcd/mezzanine/blob/master/docs/model-customization.rst#field-injection-caveats MIGRATION_MODULES = { - "blog": "sandbox.migrations.blog", - "forms": "sandbox.migrations.forms", - "galleries": "sandbox.migrations.galleries", - "pages": "sandbox.migrations.pages", - "conf": "sandbox.migrations.conf", + "blog": "migrations.blog", + "forms": "migrations.forms", + "galleries": "migrations.galleries", + "pages": "migrations.pages", + "conf": "migrations.conf", } # List of processors used by RequestContext to populate the context. @@ -246,6 +247,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( # these middleware classes will be applied in the order given, and in the # response phase the middleware will be applied in reverse order. MIDDLEWARE_CLASSES = ( + # 'sandbox.middleware.StartupMiddleware', "mezzanine.core.middleware.UpdateCacheMiddleware", 'django.contrib.sessions.middleware.SessionMiddleware', # Uncomment if using internationalisation or localisation diff --git a/app/sandbox/urls.py b/app/sandbox/urls.py index e9ecdb81..bbf5af81 100644 --- a/app/sandbox/urls.py +++ b/app/sandbox/urls.py @@ -25,7 +25,7 @@ if settings.USE_MODELTRANSLATION: ) urlpatterns += patterns('', - # (r'^newsletter/', include('newsletter.urls')), + (r'^festival/', include('festival.urls')), # We don't want to presume how your homepage works, so here are a # few patterns you can use to set it up. diff --git a/app/wait.py b/app/wait.py index c70dc753..451e5b87 100644 --- a/app/wait.py +++ b/app/wait.py @@ -6,9 +6,11 @@ from django.core.management import call_command up = False os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sandbox.settings") -# while not up: -# try: -call_command('syncdb', interactive=False) - # up = True - # except: - # time.sleep(1) +while not up: + try: + call_command('syncdb', interactive=False) + up = True + except: + print 'waiting...' + time.sleep(10) + call_command('syncdb', interactive=False) diff --git a/docker-compose.yml b/docker-compose.yml index f9c16106..7323c1d4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,25 +27,40 @@ data: - ./data/backup/:/srv/backup command: "true" +# db: +# image: mariadb +# volumes_from: +# - data +# volumes: +# - ./data/var/lib/mysql/:/var/lib/mysql +# environment: +# - MYSQL_ROOT_PASSWORD=hyRob0otlaz4 +# - MYSQL_DATABASE=manifeste +# - MYSQL_USER=manifeste +# - MYSQL_PASSWORD=Onukifsid7 + db: - image: mariadb + image: postgres + volumes: + - ./data/var/lib/postgresql/manifeste/data/:/var/lib/postgresql/data volumes_from: - data - volumes: - - ./data/var/lib/mysql/:/var/lib/mysql environment: - - MYSQL_ROOT_PASSWORD=hyRob0otlaz4 - - MYSQL_DATABASE=manifeste - - MYSQL_USER=manifeste - - MYSQL_PASSWORD=Onukifsid7 + - POSTGRES_PASSWORD=mysecretpassword + - POSTGRES_USER=postgres + - POSTGRES_DB=manifeste + pgdb: image: postgres + volumes: + - ./data/var/lib/postgresql/eve/data/:/var/lib/postgresql/data volumes_from: - data environment: - POSTGRES_PASSWORD=mysecretpassword - POSTGRES_USER=postgres + - POSTGRES_DB=eve app: build: . diff --git a/requirements.txt b/requirements.txt index 31036959..5bd91532 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,3 +10,4 @@ django-modeltranslation django-meta mezzanine-bsbanners psycopg2 +#django-location-field