From 37e6d51792c900e21b0f8be74af27c5d4bb6b5ac Mon Sep 17 00:00:00 2001 From: James Tauber Date: Sun, 5 Feb 2012 21:59:14 -0500 Subject: [PATCH] initial conference/section models --- symposion_project/apps/conference/__init__.py | 0 symposion_project/apps/conference/admin.py | 7 ++++ symposion_project/apps/conference/models.py | 40 +++++++++++++++++++ symposion_project/settings.py | 1 + 4 files changed, 48 insertions(+) create mode 100644 symposion_project/apps/conference/__init__.py create mode 100644 symposion_project/apps/conference/admin.py create mode 100644 symposion_project/apps/conference/models.py diff --git a/symposion_project/apps/conference/__init__.py b/symposion_project/apps/conference/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/symposion_project/apps/conference/admin.py b/symposion_project/apps/conference/admin.py new file mode 100644 index 00000000..e385acdf --- /dev/null +++ b/symposion_project/apps/conference/admin.py @@ -0,0 +1,7 @@ +from django.contrib import admin + +from conference.models import Conference, Section + + +admin.site.register(Conference, list_display=("title", "start_date", "end_date")) +admin.site.register(Section, list_display=("name", "conference", "start_date", "end_date")) diff --git a/symposion_project/apps/conference/models.py b/symposion_project/apps/conference/models.py new file mode 100644 index 00000000..b09c94bf --- /dev/null +++ b/symposion_project/apps/conference/models.py @@ -0,0 +1,40 @@ +from django.db import models + +from timezones.fields import TimeZoneField + + +class Conference(models.Model): + """ + the full conference for a specific year, e.g. US PyCon 2012. + """ + + title = models.CharField(max_length=100) + + # when the conference runs + start_date = models.DateField(null=True, blank=True) + end_date = models.DateField(null=True, blank=True) + + # timezone the conference is in + timezone = TimeZoneField(blank=True) + + def __unicode__(self): + return self.title + + +class Section(models.Model): + """ + a section of the conference such as "Tutorials", "Workshops", + "Talks", "Expo", "Sprints", that may have its own review and + scheduling process. + """ + + conference = models.ForeignKey(Conference) + + name = models.CharField(max_length=100) + + # when the section runs + start_date = models.DateField(null=True, blank=True) + end_date = models.DateField(null=True, blank=True) + + def __unicode__(self): + return self.name diff --git a/symposion_project/settings.py b/symposion_project/settings.py index c84b830a..84d742a5 100644 --- a/symposion_project/settings.py +++ b/symposion_project/settings.py @@ -164,6 +164,7 @@ INSTALLED_APPS = [ # project "about", + "conference", ] FIXTURE_DIRS = [