summaryrefslogtreecommitdiff
path: root/project/scipycon/base
diff options
context:
space:
mode:
Diffstat (limited to 'project/scipycon/base')
-rw-r--r--project/scipycon/base/__init__.py0
-rw-r--r--project/scipycon/base/admin.py45
-rw-r--r--project/scipycon/base/models.py81
3 files changed, 126 insertions, 0 deletions
diff --git a/project/scipycon/base/__init__.py b/project/scipycon/base/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/project/scipycon/base/__init__.py
diff --git a/project/scipycon/base/admin.py b/project/scipycon/base/admin.py
new file mode 100644
index 0000000..118808d
--- /dev/null
+++ b/project/scipycon/base/admin.py
@@ -0,0 +1,45 @@
+from django.contrib import admin
+
+from project.scipycon.base.models import Event
+from project.scipycon.base.models import Timeline
+
+
+class EventAdmin(admin.ModelAdmin):
+ list_display = ('name', 'turn', 'status', 'scope')
+ list_filter = ('name', 'turn', 'status',)
+ search_fields = ('name', 'turn', 'status',)
+ fieldsets = (
+ ('Details', {
+ 'fields': ('name', 'turn', 'status', 'scope')
+ }),
+ )
+
+
+class TimelineAdmin(admin.ModelAdmin):
+ list_display = ('registration_start', 'registration_end', 'cfp_start',
+ 'cfp_end', 'accepted_papers_announced',
+ 'proceedings_paper_deadline', 'event_start',
+ 'event_end', 'event')
+ list_filter = ('registration_start', 'registration_end', 'cfp_start',
+ 'cfp_end', 'accepted_papers_announced',
+ 'proceedings_paper_deadline', 'event_start',
+ 'event_end', 'event')
+ search_fields = ('registration_start', 'registration_end', 'cfp_start',
+ 'cfp_end', 'accepted_papers_announced',
+ 'proceedings_paper_deadline', 'event_start',
+ 'event_end')
+ fieldsets = (
+ ('Registration', {
+ 'fields': ('registration_start', 'registration_end')
+ }),
+ ('Call for Papers', {
+ 'fields': ('cfp_start', 'cfp_end', 'accepted_papers_announced',
+ 'proceedings_paper_deadline')
+ }),
+ ('Event', {
+ 'fields': ('event_start', 'event_end', 'event')
+ }),
+ )
+
+admin.site.register(Event, EventAdmin)
+admin.site.register(Timeline, TimelineAdmin)
diff --git a/project/scipycon/base/models.py b/project/scipycon/base/models.py
new file mode 100644
index 0000000..3146ca4
--- /dev/null
+++ b/project/scipycon/base/models.py
@@ -0,0 +1,81 @@
+from django.db import models
+
+
+class Event(models.Model):
+ """Data model which holds the data related to the scope or the event.
+ """
+
+ # Different states the Event can be in
+ STATUS_CHOICES = (
+ ('active', 'Active'),
+ ('inactive', 'Inactive'),
+ )
+
+ # Scope of the program, used as a URL prefix
+ scope = models.CharField(max_length=255)
+
+ # Name of the program
+ name = models.CharField(max_length=255)
+
+ # Event specific i.e version of the event
+ turn = models.CharField(max_length=255)
+
+ # Status of the program
+ status = models.CharField(max_length=255, choices=STATUS_CHOICES)
+
+ def __unicode__(self):
+ return '%s %s' % (self.name, self.turn)
+
+ def get_full_name(self):
+ return self.__unicode__()
+
+
+class Timeline(models.Model):
+ """Timeline of the program
+ """
+
+ # Event with which this timeline is associated
+ event = models.OneToOneField(Event)
+
+ # Start of registration for the program
+ registration_start = models.DateTimeField(blank=True, null=True)
+
+ # End of registration for the program
+ registration_end = models.DateTimeField(blank=True, null=True)
+
+ # Start of Call for Papers
+ cfp_start = models.DateTimeField(blank=True, null=True)
+
+ # End of Call for Papers
+ cfp_end = models.DateTimeField(blank=True, null=True)
+
+ # Accepted papers announced
+ accepted_papers_announced = models.DateTimeField(blank=True, null=True)
+
+ # Deadline to submit proceedings paper
+ proceedings_paper_deadline = models.DateTimeField(blank=True, null=True)
+
+ # Start of the actual program
+ event_start = models.DateTimeField(blank=True, null=True)
+
+ # End of the actual program
+ event_end = models.DateTimeField(blank=True, null=True)
+
+ def __unicode__(self):
+ return '%s %s' % (self.event.name, self.event.turn)
+
+
+class ScopedBase(models.Model):
+ """Base model which is in turn inherited by other models
+ which needs to be scoped.
+ """
+
+ # Scope of entity in which it is visible
+ scope = models.ForeignKey(Event)
+
+ class Meta:
+ abstract = True
+
+
+class Paid(models.Model):
+ event_start = models.DateTimeField(blank=True, null=True)