# slug
BLOG_SLUG = 'article'
+
+
+AJAX_LOOKUP_CHANNELS = {
+ 'article': {'model': 'organization.magazine.article', 'search_field': 'title'},
+ 'basepage': {'model': 'organization.core.basepage', 'search_field': 'title'},
+}
from django.contrib import admin
+from django import forms
+from copy import deepcopy
+from mezzanine.core.admin import DisplayableAdmin
+from organization.magazine.models import Brief
+from ajax_select import make_ajax_form
+from ajax_select.admin import AjaxSelectAdmin
+from ajax_select.fields import AutoCompleteSelectField
+from organization.magazine.models import Brief
-# Register your models here.
+
+class BriefAdmin(AjaxSelectAdmin):
+
+ model = Brief
+
+class BriefAdminDisplayable(DisplayableAdmin):
+
+ #make_ajax_form(Label, {'ville': 'ville'})
+ #id_local_content = AutoCompleteSelectField('local_content', label="local_content")
+ form = make_ajax_form(Brief, {'local_content': 'article'})
+ fieldsets = deepcopy(BriefAdmin.fieldsets)
+
+admin.site.register(Brief, BriefAdminDisplayable)
--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-07-07 11:23
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('sites', '0002_alter_domain_unique'),
+ ('organization magazine', '0002_article'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='Brief',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('keywords_string', models.CharField(blank=True, editable=False, max_length=500)),
+ ('title', models.CharField(max_length=500, verbose_name='Title')),
+ ('slug', models.CharField(blank=True, help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL')),
+ ('_meta_title', models.CharField(blank=True, 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')),
+ ('description', models.TextField(blank=True, verbose_name='Description')),
+ ('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(editable=False, null=True)),
+ ('updated', models.DateTimeField(editable=False, null=True)),
+ ('status', models.IntegerField(choices=[(1, 'Draft'), (2, 'Published')], default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status')),
+ ('publish_date', models.DateTimeField(blank=True, db_index=True, help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from')),
+ ('expiry_date', models.DateTimeField(blank=True, help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on')),
+ ('short_url', models.URLField(blank=True, null=True)),
+ ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')),
+ ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')),
+ ('text_button', models.CharField(blank=True, max_length=150, verbose_name='text button')),
+ ('text_button_fr', models.CharField(blank=True, max_length=150, null=True, verbose_name='text button')),
+ ('text_button_en', models.CharField(blank=True, max_length=150, null=True, verbose_name='text button')),
+ ('site', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='sites.Site')),
+ ],
+ options={
+ 'verbose_name': 'brief',
+ },
+ ),
+ ]
--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-07-07 13:44
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organization magazine', '0003_brief'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='brief',
+ name='local_content',
+ field=models.CharField(blank=True, max_length=1000, verbose_name='local content'),
+ ),
+ migrations.AddField(
+ model_name='brief',
+ name='local_content_en',
+ field=models.CharField(blank=True, max_length=1000, null=True, verbose_name='local content'),
+ ),
+ migrations.AddField(
+ model_name='brief',
+ name='local_content_fr',
+ field=models.CharField(blank=True, max_length=1000, null=True, verbose_name='local content'),
+ ),
+ ]
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse, reverse_lazy
+from mezzanine.core.models import RichText, Displayable, Slugged
from mezzanine.blog.models import BlogPost
from organization.core.models import Named
+
class Article(BlogPost):
sub_title = models.CharField(_('sub title'), blank=True, max_length=1000)
class Meta:
verbose_name = _('article')
+class Brief(Displayable, RichText):
+
+ text_button = models.CharField(blank=True, max_length=150, null=False, verbose_name='text button')
+ local_content = models.CharField(blank=True, max_length=1000, null=False, verbose_name='local content')
+
+ class Meta:
+ verbose_name = _('brief')
+
+
class Category(Named):
"""(Category description)"""
from mezzanine.core.translation import (TranslatedSlugged,
TranslatedDisplayable,
TranslatedRichText)
-from organization.magazine.models import Article
+from organization.magazine.models import Article, Brief
@register(Article)
#class ArticleTranslationOptions(TranslatedDisplayable, TranslatedRichText):
class ArticleTranslationOptions(TranslationOptions):
fields = ('sub_title',)
+
+
+@register(Brief)
+class AudioTranslationOptions(TranslationOptions):
+
+ fields = ('text_button', 'local_content')
--- /dev/null
+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 django.conf.urls import *
+from django.contribimport admin
+from ajax_select import urls as ajax_select_urls
+
+admin.autodiscover()
+
+urlpatterns = [
+ urls (r'^admin/lookups/', include(ajax_select_urls)), (r'^admin/', include(admin.site.urls)),
+]
'djangobower',
"meta",
"mezzanine_agenda",
+ "ajax_select",
"organization.core",
"organization.structure",
"organization.festival",
-e git+https://github.com/yomguy/mezzanine-agenda.git#egg=mezzanine-agenda-0.2.2
-e git+https://github.com/stephenmcd/mezzanine.git#egg=mezzanine-4.1-dev
+-e git+https://github.com/stephenmcd/grappelli-safe#egg=grappelli-safe-0.4.2
#https://forge.ircam.fr/p/django-eve/source/download/dev/
#
#
django-debug-toolbar
django-extensions
django-countries
+django-ajax-selects