summaryrefslogtreecommitdiffstats
path: root/cal/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'cal/models.py')
-rw-r--r--cal/models.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/cal/models.py b/cal/models.py
new file mode 100644
index 0000000..ae46f3f
--- /dev/null
+++ b/cal/models.py
@@ -0,0 +1,34 @@
+from django.db import models
+from django.contrib.auth.models import User,Group
+from infopoint.agenda import *
+from infopoint.agenda.models import *
+
+import eventCalBase
+
+class EventCalendar(models.Model):
+ class Admin:
+ pass
+
+ owner = models.ForeignKey(User)
+ year = models.IntegerField()
+ month = models.IntegerField()
+
+ class Meta:
+ unique_together = (('owner', 'year', 'month'),)
+
+ def __str__(self):
+ return 'of %s for %02d/%04d' % (
+ self.owner, self.month, self.year)
+
+
+class Event(models.Model):
+ class Admin:
+ pass
+
+ title = models.ForeignKey(Event)
+ cal = models.ForeignKey(EventCalendar)
+
+ def __str__(self):
+ return '%s @ %s' % (self.title, self.when)
+
+