(_('Content'), ('pages.Page', 'blog.BlogPost', 'mezzanine_agenda.Event',
'generic.ThreadedComment', (_('Media Library'), 'fb_browse'),)),
(_("Magazine"), ("magazine.Article",)),
- (_('Structure'), ('organization.structure.Organization', 'organization.structure.Team',
- 'organization.structure.Department', 'organization.structure.Person',
- 'organization.structure.Activity')),
+ (_('team'), ('organization.team.Organization', 'organization.team.Team',
+ 'organization.team.Department', 'organization.team.Person',
+ 'organization.team.Activity')),
(_('Projects'), ('organization.project.Project')),
(_('Festival'), ('organization.festival.Artist', 'organization.festival.Video',
'organization.festival.Audio', 'organization.festival.Playlist',
--- /dev/null
+from __future__ import unicode_literals
+
+import django.views.i18n
+from django.conf.urls import patterns, include, url
+from django.conf.urls.i18n import i18n_patterns
+
+from mezzanine.core.views import direct_to_template
+from mezzanine.conf import settings
+
+from organization.core.views import HomeView
+
+
+urlpatterns = [
+ url("^$", HomeView.as_view(), name="home"),
+]
-from django.shortcuts import render
+from django.shortcuts import render, get_object_or_404
+from django.http import Http404
+from django.views.generic.base import View
+from django.views.generic import DetailView, ListView, TemplateView
class SlugMixin(object):
def get_object(self):
objects = self.model.objects.all()
return get_object_or_404(objects, slug=self.kwargs['slug'])
+
+
+class HomeView(TemplateView):
+
+ template_name = 'index.html'
+
+ def get_context_data(self, **kwargs):
+ context = super(HomeView, self).get_context_data(**kwargs)
+ return context
--- /dev/null
+from __future__ import unicode_literals
+
+import django.views.i18n
+from django.conf.urls import patterns, include, url
+from django.conf.urls.i18n import i18n_patterns
+
+from mezzanine.core.views import direct_to_template
+from mezzanine.conf import settings
+
+
+urlpatterns = [
+
+]
from __future__ import unicode_literals
+import django.views.i18n
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
--- /dev/null
+from __future__ import unicode_literals
+
+import django.views.i18n
+from django.conf.urls import patterns, include, url
+from django.conf.urls.i18n import i18n_patterns
+
+from mezzanine.core.views import direct_to_template
+from mezzanine.conf import settings
+
+
+urlpatterns = [
+
+]
from __future__ import unicode_literals
+import django.views.i18n
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 organization.festival.views import *
+from organization.media.views import *
urlpatterns = [
dependencies = [
('sites', '0002_alter_domain_unique'),
('organization project', '0001_initial'),
- ('organization structure', '0001_initial'),
+ ('organization team', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='project',
name='partners',
- field=models.ManyToManyField(to='organization structure.Organization', verbose_name='organizations'),
+ field=models.ManyToManyField(to='organization team.Organization', verbose_name='organizations'),
),
migrations.AddField(
model_name='project',
name='persons',
- field=models.ManyToManyField(to='organization structure.Person', verbose_name='persons'),
+ field=models.ManyToManyField(to='organization team.Person', verbose_name='persons'),
),
migrations.AddField(
model_name='project',
from mezzanine.core.models import RichText, Displayable, Slugged
-from organization.structure.models import Person, Organization
+from organization.team.models import Person, Organization
class Project(Displayable, RichText):
--- /dev/null
+from __future__ import unicode_literals
+
+import django.views.i18n
+from django.conf.urls import patterns, include, url
+from django.conf.urls.i18n import i18n_patterns
+
+from mezzanine.core.views import direct_to_template
+from mezzanine.conf import settings
+
+
+urlpatterns = [
+
+]
+++ /dev/null
-"""
-Provides abstract models and admin features used throughout the various
-Mezzanine apps.
-"""
-from __future__ import unicode_literals
-
-from mezzanine import __version__ # noqa
-
-
-default_app_config = 'organization.structure.apps.StructureConfig'
+++ /dev/null
-from django.contrib import admin
-
-# Register your models here.
+++ /dev/null
-from __future__ import unicode_literals
-
-from django.apps import AppConfig
-
-
-class StructureConfig(AppConfig):
-
- name = 'organization.structure'
- label = 'organization structure'
+++ /dev/null
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.7 on 2016-07-07 08:53
-from __future__ import unicode_literals
-
-from django.conf import settings
-from django.db import migrations, models
-import django.db.models.deletion
-import django_countries.fields
-import mezzanine.core.fields
-import mezzanine.utils.models
-
-
-class Migration(migrations.Migration):
-
- initial = True
-
- dependencies = [
- ('sites', '0002_alter_domain_unique'),
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ]
-
- operations = [
- migrations.CreateModel(
- name='Activity',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('date_begin', models.DateField(blank=True, null=True, verbose_name='begin date')),
- ('date_end', models.DateField(blank=True, null=True, verbose_name='end date')),
- ('role', models.CharField(blank=True, max_length=512, verbose_name='role')),
- ('work', models.TextField(blank=True, verbose_name='work')),
- ],
- ),
- migrations.CreateModel(
- name='Address',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('address', models.TextField(blank=True, verbose_name='description')),
- ('postal_code', models.CharField(blank=True, max_length=16, verbose_name='postal code')),
- ('country', django_countries.fields.CountryField(max_length=2, verbose_name='country')),
- ],
- ),
- migrations.CreateModel(
- name='Department',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('name', models.CharField(max_length=512, verbose_name='name')),
- ('description', models.TextField(blank=True, verbose_name='description')),
- ('url', models.URLField(blank=True, max_length=512, verbose_name='URL')),
- ('weaving_class', models.CharField(blank=True, max_length=64, verbose_name='weaving class')),
- ],
- options={
- 'verbose_name': 'department',
- },
- ),
- migrations.CreateModel(
- name='Link',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('url', models.URLField(verbose_name='URL')),
- ],
- ),
- migrations.CreateModel(
- name='LinkType',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('name', models.CharField(max_length=256, verbose_name='Name')),
- ('slug', models.SlugField(blank=True, help_text='Use this field to define a simple identifier that can be used to style the different link types (i.e. assign social media icons to them)', max_length=256, verbose_name='Slug')),
- ('ordering', models.PositiveIntegerField(blank=True, null=True, verbose_name='Ordering')),
- ],
- options={
- 'ordering': ['ordering'],
- },
- ),
- migrations.CreateModel(
- name='Modelname',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ],
- ),
- migrations.CreateModel(
- name='Nationality',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('name', models.CharField(max_length=128, verbose_name='name')),
- ],
- ),
- migrations.CreateModel(
- name='OrganizationType',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('name', models.CharField(max_length=512, verbose_name='name')),
- ('description', models.TextField(blank=True, verbose_name='description')),
- ],
- options={
- 'verbose_name': 'organization type',
- },
- ),
- migrations.CreateModel(
- name='Person',
- 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')),
- ('photo', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='photo')),
- ('photo_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo credits')),
- ('photo_alignment', models.CharField(blank=True, choices=[('left', 'left'), ('center', 'center'), ('right', 'right')], default='left', max_length=32, verbose_name='photo alignment')),
- ('photo_description', models.TextField(blank=True, verbose_name='photo description')),
- ('photo_card', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='card photo')),
- ('photo_card_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo card credits')),
- ('photo_slider', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='slider photo')),
- ('photo_slider_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo slider credits')),
- ('person_title', models.CharField(blank=True, choices=[('Dr', 'Dr'), ('Prof', 'Prof'), ('Prof Dr', 'Prof Dr')], max_length=16, verbose_name='title')),
- ('gender', models.CharField(blank=True, choices=[('male', 'male'), ('female', 'female')], max_length=16, verbose_name='gender')),
- ('first_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='first name')),
- ('last_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='last name')),
- ('birthday', models.DateField(blank=True, verbose_name='birthday')),
- ('site', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='sites.Site')),
- ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='user')),
- ],
- options={
- 'abstract': False,
- },
- bases=(mezzanine.utils.models.AdminThumbMixin, models.Model),
- ),
- migrations.CreateModel(
- name='Team',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('name', models.CharField(max_length=512, verbose_name='name')),
- ('description', models.TextField(blank=True, verbose_name='description')),
- ('department', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='organization structure.Department', verbose_name='department')),
- ],
- options={
- 'abstract': False,
- },
- ),
- migrations.CreateModel(
- name='Organization',
- fields=[
- ('address_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='organization structure.Address')),
- ('name', models.CharField(max_length=512, verbose_name='name')),
- ('description', models.TextField(blank=True, verbose_name='description')),
- ('url', models.URLField(blank=True, max_length=512, verbose_name='URL')),
- ('type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='organization structure.OrganizationType', verbose_name='organization type')),
- ],
- options={
- 'verbose_name': 'organization',
- },
- bases=('organization structure.address', models.Model),
- ),
- migrations.AddField(
- model_name='link',
- name='link_type',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization structure.LinkType', verbose_name='Link type'),
- ),
- migrations.AddField(
- model_name='link',
- name='person',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization structure.Person', verbose_name='Person'),
- ),
- migrations.AddField(
- model_name='activity',
- name='person',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization structure.Person', verbose_name='person'),
- ),
- migrations.AddField(
- model_name='activity',
- name='teams',
- field=models.ManyToManyField(to='organization structure.Team', verbose_name='teams'),
- ),
- migrations.AddField(
- model_name='person',
- name='organization',
- field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='organization structure.Organization', verbose_name='organization'),
- ),
- migrations.AddField(
- model_name='department',
- name='organization',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization structure.Organization', verbose_name='organization'),
- ),
- ]
+++ /dev/null
-# -*- coding: utf-8 -*-
-# Generated by Django 1.9.7 on 2016-07-07 14:14
-from __future__ import unicode_literals
-
-from django.db import migrations
-import mezzanine.core.fields
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('organization structure', '0001_initial'),
- ]
-
- operations = [
- migrations.DeleteModel(
- name='Modelname',
- ),
- migrations.AlterModelOptions(
- name='person',
- options={'ordering': ['last_name'], 'verbose_name': 'person'},
- ),
- migrations.AddField(
- model_name='person',
- name='bio',
- field=mezzanine.core.fields.RichTextField(blank=True, verbose_name='biography'),
- ),
- ]
+++ /dev/null
-from __future__ import unicode_literals
-
-import os
-import re
-import pwd
-import time
-import urllib
-import string
-import datetime
-import mimetypes
-
-from django.db import models
-from django.utils.translation import ugettext_lazy as _
-from django.core.urlresolvers import reverse, reverse_lazy
-from django.conf import settings
-from django.contrib.auth.models import User
-
-from mezzanine.core.models import RichText, Displayable, Slugged
-from mezzanine.core.fields import RichTextField, OrderField, FileField
-from mezzanine.utils.models import AdminThumbMixin, upload_to
-
-from django_countries.fields import CountryField
-
-from organization.media.models import Photo
-from organization.core.models import Named
-
-# Hack to have these strings translated
-mr = _('Mr')
-mrs = _('Ms')
-
-GENDER_CHOICES = [
- ('male', _('male')),
- ('female', _('female')),
-]
-
-TITLE_CHOICES = [
- ('Dr', _('Dr')),
- ('Prof', _('Prof')),
- ('Prof Dr', _('Prof Dr')),
-]
-
-ALIGNMENT_CHOICES = (('left', _('left')), ('right', _('right')))
-
-
-
-class Address(models.Model):
- """(Address description)"""
-
- address = models.TextField(_('description'), blank=True)
- postal_code = models.CharField(_('postal code'), max_length=16, blank=True)
- country = CountryField(_('country'))
-
- def __unicode__(self):
- return u"Address"
-
- class Meta:
- abstract = True
-
-
-class Organization(Named, Address):
- """(Organization description)"""
-
- type = models.ForeignKey('OrganizationType', verbose_name=_('organization type'), blank=True, null=True, on_delete=models.SET_NULL)
- url = models.URLField(_('URL'), max_length=512, blank=True)
-
- def __unicode__(self):
- return self.name
-
- class Meta:
- verbose_name = _('organization')
-
-
-class OrganizationType(Named):
- """(OrganizationType description)"""
-
- class Meta:
- verbose_name = _('organization type')
-
-
-class Department(Named):
- """(Department description)"""
-
- organization = models.ForeignKey('Organization', verbose_name=_('organization'))
- url = models.URLField(_('URL'), max_length=512, blank=True)
- weaving_class = models.CharField(_('weaving class'), max_length=64, blank=True)
-
- def __unicode__(self):
- return self.name
-
- class Meta:
- verbose_name = _('department')
-
-
-class Team(Named):
- """(Team description)"""
-
- department = models.ForeignKey('Department', verbose_name=_('department'), blank=True, null=True, on_delete=models.SET_NULL)
-
- def __unicode__(self):
- return u"Team"
-
-
-class Person(Displayable, RichText, AdminThumbMixin, Photo):
- """(Person description)"""
-
- user = models.ForeignKey(User, verbose_name=_('user'), blank=True, null=True, on_delete=models.SET_NULL)
- person_title = models.CharField(_('title'), max_length=16, choices=TITLE_CHOICES, blank=True)
- gender = models.CharField(_('gender'), max_length=16, choices=GENDER_CHOICES, blank=True)
- first_name = models.CharField(_('first name'), max_length=255, blank=True, null=True)
- last_name = models.CharField(_('last name'), max_length=255, blank=True, null=True)
- birthday = models.DateField(_('birthday'), blank=True)
- organization = models.ForeignKey('Organization', verbose_name=_('organization'), blank=True, null=True, on_delete=models.SET_NULL)
- bio = RichTextField(_('biography'), blank=True)
-
- class Meta:
- verbose_name = _('person')
- ordering = ['last_name',]
-
- def __unicode__(self):
- return ' '.join((self.user.first_name, self.user.last_name))
-
- # def get_absolute_url(self):
- # return reverse("festival-artist-detail", kwargs={'slug': self.slug})
-
- def set_names(self):
- names = self.title.split(' ')
- if len(names) == 1:
- self.first_name = ''
- self.last_name = names[0]
- elif len(names) == 2:
- self.first_name = names[0]
- self.last_name = names[1]
- else:
- self.first_name = names[0]
- self.last_name = ' '.join(names[1:])
-
- def clean(self):
- super(Person, self).clean()
- self.set_names()
-
- def save(self, *args, **kwargs):
- self.set_names()
- super(Person, self).save(*args, **kwargs)
-
-
-class Nationality(models.Model):
- """(Nationality description)"""
-
- name = models.CharField(_('name'), max_length=128)
-
- def __unicode__(self):
- return self.name
-
-
-class Link(models.Model):
- """A person can have many links."""
-
- person = models.ForeignKey('Person', verbose_name=_('Person'))
- link_type = models.ForeignKey('LinkType', verbose_name=_('Link type'))
- url = models.URLField(verbose_name=_('URL'))
-
- def __str__(self):
- return self.url
-
-
-class LinkType(models.Model):
- """
- A link type could be ``Facebook`` or ``Twitter`` or ``Website``.
- This is masterdata that should be created by the admins when the site is
- deployed for the first time.
- :ordering: Enter numbers here if you want links to be displayed in a
- special order.
- """
-
- name = models.CharField(max_length=256, verbose_name=_('Name'))
- slug = models.SlugField(max_length=256, verbose_name=_('Slug'), help_text=_(
- 'Use this field to define a simple identifier that can be used'
- ' to style the different link types (i.e. assign social media'
- ' icons to them)'),
- blank=True,
- )
- ordering = models.PositiveIntegerField(verbose_name=_('Ordering'), null=True, blank=True)
-
- class Meta:
- ordering = ['ordering', ]
-
- def __str__(self):
- return self.name
-
-
-class Activity(models.Model):
- """(Activity description)"""
-
- person = models.ForeignKey('Person', verbose_name=_('person'))
- teams = models.ManyToManyField('Team', verbose_name=_('teams'))
- date_begin = models.DateField(_('begin date'), null=True, blank=True)
- date_end = models.DateField(_('end date'), null=True, blank=True)
- role = models.CharField(_('role'), blank=True, max_length=512)
- work = models.TextField(_('work'), blank=True)
-
- def __unicode__(self):
- return ' - '.join((self.person, self.role, self.date_begin, self.date_end))
+++ /dev/null
-from django.test import TestCase
-
-# Create your tests here.
+++ /dev/null
-from django.shortcuts import render
-
-# Create your views here.
--- /dev/null
+"""
+Provides abstract models and admin features used throughout the various
+Mezzanine apps.
+"""
+from __future__ import unicode_literals
+
+from mezzanine import __version__ # noqa
+
+
+default_app_config = 'organization.team.apps.teamConfig'
--- /dev/null
+from django.contrib import admin
+
+# Register your models here.
--- /dev/null
+from __future__ import unicode_literals
+
+from django.apps import AppConfig
+
+
+class teamConfig(AppConfig):
+
+ name = 'organization.team'
+ label = 'organization team'
--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-07-07 08:53
+from __future__ import unicode_literals
+
+from django.conf import settings
+from django.db import migrations, models
+import django.db.models.deletion
+import django_countries.fields
+import mezzanine.core.fields
+import mezzanine.utils.models
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ ('sites', '0002_alter_domain_unique'),
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='Activity',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('date_begin', models.DateField(blank=True, null=True, verbose_name='begin date')),
+ ('date_end', models.DateField(blank=True, null=True, verbose_name='end date')),
+ ('role', models.CharField(blank=True, max_length=512, verbose_name='role')),
+ ('work', models.TextField(blank=True, verbose_name='work')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Address',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('address', models.TextField(blank=True, verbose_name='description')),
+ ('postal_code', models.CharField(blank=True, max_length=16, verbose_name='postal code')),
+ ('country', django_countries.fields.CountryField(max_length=2, verbose_name='country')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Department',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('name', models.CharField(max_length=512, verbose_name='name')),
+ ('description', models.TextField(blank=True, verbose_name='description')),
+ ('url', models.URLField(blank=True, max_length=512, verbose_name='URL')),
+ ('weaving_class', models.CharField(blank=True, max_length=64, verbose_name='weaving class')),
+ ],
+ options={
+ 'verbose_name': 'department',
+ },
+ ),
+ migrations.CreateModel(
+ name='Link',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('url', models.URLField(verbose_name='URL')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='LinkType',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('name', models.CharField(max_length=256, verbose_name='Name')),
+ ('slug', models.SlugField(blank=True, help_text='Use this field to define a simple identifier that can be used to style the different link types (i.e. assign social media icons to them)', max_length=256, verbose_name='Slug')),
+ ('ordering', models.PositiveIntegerField(blank=True, null=True, verbose_name='Ordering')),
+ ],
+ options={
+ 'ordering': ['ordering'],
+ },
+ ),
+ migrations.CreateModel(
+ name='Modelname',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Nationality',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('name', models.CharField(max_length=128, verbose_name='name')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='OrganizationType',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('name', models.CharField(max_length=512, verbose_name='name')),
+ ('description', models.TextField(blank=True, verbose_name='description')),
+ ],
+ options={
+ 'verbose_name': 'organization type',
+ },
+ ),
+ migrations.CreateModel(
+ name='Person',
+ 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')),
+ ('photo', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='photo')),
+ ('photo_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo credits')),
+ ('photo_alignment', models.CharField(blank=True, choices=[('left', 'left'), ('center', 'center'), ('right', 'right')], default='left', max_length=32, verbose_name='photo alignment')),
+ ('photo_description', models.TextField(blank=True, verbose_name='photo description')),
+ ('photo_card', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='card photo')),
+ ('photo_card_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo card credits')),
+ ('photo_slider', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='slider photo')),
+ ('photo_slider_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo slider credits')),
+ ('person_title', models.CharField(blank=True, choices=[('Dr', 'Dr'), ('Prof', 'Prof'), ('Prof Dr', 'Prof Dr')], max_length=16, verbose_name='title')),
+ ('gender', models.CharField(blank=True, choices=[('male', 'male'), ('female', 'female')], max_length=16, verbose_name='gender')),
+ ('first_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='first name')),
+ ('last_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='last name')),
+ ('birthday', models.DateField(blank=True, verbose_name='birthday')),
+ ('site', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='sites.Site')),
+ ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='user')),
+ ],
+ options={
+ 'abstract': False,
+ },
+ bases=(mezzanine.utils.models.AdminThumbMixin, models.Model),
+ ),
+ migrations.CreateModel(
+ name='Team',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('name', models.CharField(max_length=512, verbose_name='name')),
+ ('description', models.TextField(blank=True, verbose_name='description')),
+ ('department', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='organization team.Department', verbose_name='department')),
+ ],
+ options={
+ 'abstract': False,
+ },
+ ),
+ migrations.CreateModel(
+ name='Organization',
+ fields=[
+ ('address_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='organization team.Address')),
+ ('name', models.CharField(max_length=512, verbose_name='name')),
+ ('description', models.TextField(blank=True, verbose_name='description')),
+ ('url', models.URLField(blank=True, max_length=512, verbose_name='URL')),
+ ('type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='organization team.OrganizationType', verbose_name='organization type')),
+ ],
+ options={
+ 'verbose_name': 'organization',
+ },
+ bases=('organization team.address', models.Model),
+ ),
+ migrations.AddField(
+ model_name='link',
+ name='link_type',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization team.LinkType', verbose_name='Link type'),
+ ),
+ migrations.AddField(
+ model_name='link',
+ name='person',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization team.Person', verbose_name='Person'),
+ ),
+ migrations.AddField(
+ model_name='activity',
+ name='person',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization team.Person', verbose_name='person'),
+ ),
+ migrations.AddField(
+ model_name='activity',
+ name='teams',
+ field=models.ManyToManyField(to='organization team.Team', verbose_name='teams'),
+ ),
+ migrations.AddField(
+ model_name='person',
+ name='organization',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='organization team.Organization', verbose_name='organization'),
+ ),
+ migrations.AddField(
+ model_name='department',
+ name='organization',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization team.Organization', verbose_name='organization'),
+ ),
+ ]
--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-07-07 14:14
+from __future__ import unicode_literals
+
+from django.db import migrations
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organization team', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.DeleteModel(
+ name='Modelname',
+ ),
+ migrations.AlterModelOptions(
+ name='person',
+ options={'ordering': ['last_name'], 'verbose_name': 'person'},
+ ),
+ migrations.AddField(
+ model_name='person',
+ name='bio',
+ field=mezzanine.core.fields.RichTextField(blank=True, verbose_name='biography'),
+ ),
+ ]
--- /dev/null
+from __future__ import unicode_literals
+
+import os
+import re
+import pwd
+import time
+import urllib
+import string
+import datetime
+import mimetypes
+
+from django.db import models
+from django.utils.translation import ugettext_lazy as _
+from django.core.urlresolvers import reverse, reverse_lazy
+from django.conf import settings
+from django.contrib.auth.models import User
+
+from mezzanine.core.models import RichText, Displayable, Slugged
+from mezzanine.core.fields import RichTextField, OrderField, FileField
+from mezzanine.utils.models import AdminThumbMixin, upload_to
+
+from django_countries.fields import CountryField
+
+from organization.media.models import Photo
+from organization.core.models import Named
+
+# Hack to have these strings translated
+mr = _('Mr')
+mrs = _('Ms')
+
+GENDER_CHOICES = [
+ ('male', _('male')),
+ ('female', _('female')),
+]
+
+TITLE_CHOICES = [
+ ('Dr', _('Dr')),
+ ('Prof', _('Prof')),
+ ('Prof Dr', _('Prof Dr')),
+]
+
+ALIGNMENT_CHOICES = (('left', _('left')), ('right', _('right')))
+
+
+
+class Address(models.Model):
+ """(Address description)"""
+
+ address = models.TextField(_('description'), blank=True)
+ postal_code = models.CharField(_('postal code'), max_length=16, blank=True)
+ country = CountryField(_('country'))
+
+ def __unicode__(self):
+ return u"Address"
+
+ class Meta:
+ abstract = True
+
+
+class Organization(Named, Address):
+ """(Organization description)"""
+
+ type = models.ForeignKey('OrganizationType', verbose_name=_('organization type'), blank=True, null=True, on_delete=models.SET_NULL)
+ url = models.URLField(_('URL'), max_length=512, blank=True)
+
+ def __unicode__(self):
+ return self.name
+
+ class Meta:
+ verbose_name = _('organization')
+
+
+class OrganizationType(Named):
+ """(OrganizationType description)"""
+
+ class Meta:
+ verbose_name = _('organization type')
+
+
+class Department(Named):
+ """(Department description)"""
+
+ organization = models.ForeignKey('Organization', verbose_name=_('organization'))
+ url = models.URLField(_('URL'), max_length=512, blank=True)
+ weaving_class = models.CharField(_('weaving class'), max_length=64, blank=True)
+
+ def __unicode__(self):
+ return self.name
+
+ class Meta:
+ verbose_name = _('department')
+
+
+class Team(Named):
+ """(Team description)"""
+
+ department = models.ForeignKey('Department', verbose_name=_('department'), blank=True, null=True, on_delete=models.SET_NULL)
+
+ def __unicode__(self):
+ return u"Team"
+
+
+class Person(Displayable, RichText, AdminThumbMixin, Photo):
+ """(Person description)"""
+
+ user = models.ForeignKey(User, verbose_name=_('user'), blank=True, null=True, on_delete=models.SET_NULL)
+ person_title = models.CharField(_('title'), max_length=16, choices=TITLE_CHOICES, blank=True)
+ gender = models.CharField(_('gender'), max_length=16, choices=GENDER_CHOICES, blank=True)
+ first_name = models.CharField(_('first name'), max_length=255, blank=True, null=True)
+ last_name = models.CharField(_('last name'), max_length=255, blank=True, null=True)
+ birthday = models.DateField(_('birthday'), blank=True)
+ organization = models.ForeignKey('Organization', verbose_name=_('organization'), blank=True, null=True, on_delete=models.SET_NULL)
+ bio = RichTextField(_('biography'), blank=True)
+
+ class Meta:
+ verbose_name = _('person')
+ ordering = ['last_name',]
+
+ def __unicode__(self):
+ return ' '.join((self.user.first_name, self.user.last_name))
+
+ # def get_absolute_url(self):
+ # return reverse("festival-artist-detail", kwargs={'slug': self.slug})
+
+ def set_names(self):
+ names = self.title.split(' ')
+ if len(names) == 1:
+ self.first_name = ''
+ self.last_name = names[0]
+ elif len(names) == 2:
+ self.first_name = names[0]
+ self.last_name = names[1]
+ else:
+ self.first_name = names[0]
+ self.last_name = ' '.join(names[1:])
+
+ def clean(self):
+ super(Person, self).clean()
+ self.set_names()
+
+ def save(self, *args, **kwargs):
+ self.set_names()
+ super(Person, self).save(*args, **kwargs)
+
+
+class Nationality(models.Model):
+ """(Nationality description)"""
+
+ name = models.CharField(_('name'), max_length=128)
+
+ def __unicode__(self):
+ return self.name
+
+
+class Link(models.Model):
+ """A person can have many links."""
+
+ person = models.ForeignKey('Person', verbose_name=_('Person'))
+ link_type = models.ForeignKey('LinkType', verbose_name=_('Link type'))
+ url = models.URLField(verbose_name=_('URL'))
+
+ def __str__(self):
+ return self.url
+
+
+class LinkType(models.Model):
+ """
+ A link type could be ``Facebook`` or ``Twitter`` or ``Website``.
+ This is masterdata that should be created by the admins when the site is
+ deployed for the first time.
+ :ordering: Enter numbers here if you want links to be displayed in a
+ special order.
+ """
+
+ name = models.CharField(max_length=256, verbose_name=_('Name'))
+ slug = models.SlugField(max_length=256, verbose_name=_('Slug'), help_text=_(
+ 'Use this field to define a simple identifier that can be used'
+ ' to style the different link types (i.e. assign social media'
+ ' icons to them)'),
+ blank=True,
+ )
+ ordering = models.PositiveIntegerField(verbose_name=_('Ordering'), null=True, blank=True)
+
+ class Meta:
+ ordering = ['ordering', ]
+
+ def __str__(self):
+ return self.name
+
+
+class Activity(models.Model):
+ """(Activity description)"""
+
+ person = models.ForeignKey('Person', verbose_name=_('person'))
+ teams = models.ManyToManyField('Team', verbose_name=_('teams'))
+ date_begin = models.DateField(_('begin date'), null=True, blank=True)
+ date_end = models.DateField(_('end date'), null=True, blank=True)
+ role = models.CharField(_('role'), blank=True, max_length=512)
+ work = models.TextField(_('work'), blank=True)
+
+ def __unicode__(self):
+ return ' - '.join((self.person, self.role, self.date_begin, self.date_end))
--- /dev/null
+from django.test import TestCase
+
+# Create your tests here.
--- /dev/null
+from __future__ import unicode_literals
+
+import django.views.i18n
+from django.conf.urls import patterns, include, url
+from django.conf.urls.i18n import i18n_patterns
+
+from mezzanine.core.views import direct_to_template
+from mezzanine.conf import settings
+
+from organization.team.views import *
+
+
+urlpatterns = [
+
+]
--- /dev/null
+from django.shortcuts import render
+
+# Create your views here.
--- /dev/null
+from __future__ import unicode_literals
+
+import django.views.i18n
+from django.conf.urls import patterns, include, url
+from django.conf.urls.i18n import i18n_patterns
+from django.contrib import admin
+
+admin.autodiscover()
+
+from mezzanine.core.views import direct_to_template
+from mezzanine.conf import settings
+
+
+urlpatterns = [
+ url("^", include('organization.core.urls')),
+ url("^festival/", include('organization.festival.urls')),
+ url("^magazine/", include('organization.magazine.urls')),
+ url("^media/", include('organization.media.urls')),
+ url("^project/", include('organization.project.urls')),
+ url("^team/", include('organization.team.urls')),
+]
"meta",
"mezzanine_agenda",
"organization.core",
- "organization.structure",
+ "organization.team",
"organization.festival",
"organization.magazine",
"organization.media",
urlpatterns += [
- url(r'^festival/', include('organization.festival.urls')),
+ # App urls
+
+ url("^", include('organization.urls')),
url("^%s/" % settings.EVENT_SLUG, include("mezzanine_agenda.urls")),
+ url("^styles/$", direct_to_template, {"template": "styles.html"}, name="styles"),
# We don't want to presume how your homepage works, so here are a
# few patterns you can use to set it up.
# one homepage pattern, so if you use a different one, comment this
# one out.
- url("^styles/$", direct_to_template, {"template": "styles.html"}, name="styles"),
- url("^$", direct_to_template, {"template": "index.html"}, name="home"),
+ # url("^$", direct_to_template, {"template": "index.html"}, name="home"),
# HOMEPAGE AS AN EDITABLE PAGE IN THE PAGE TREE
# ---------------------------------------------