Made Program reference Timeline
authorSverre Rabbelier <srabbelier@gmail.com>
Tue, 06 Jan 2009 16:55:27 +0000
changeset 766 046b4b51eabf
parent 765 a0a4cbd7693b
child 767 ebd938bbd3d4
Made Program reference Timeline Also made Timeline inherit from base like it should. Patch by: Sverre Rabbelier
app/soc/models/program.py
app/soc/models/timeline.py
--- a/app/soc/models/program.py	Tue Jan 06 16:01:16 2009 +0000
+++ b/app/soc/models/program.py	Tue Jan 06 16:55:27 2009 +0000
@@ -26,6 +26,7 @@
 from django.utils.translation import ugettext_lazy
 
 import soc.models.presence
+import soc.models.timeline
 
 
 class Program(soc.models.presence.Presence):
@@ -57,3 +58,9 @@
   description = db.TextProperty(required=True,
       verbose_name=ugettext_lazy('Description'))
   description.example_text = ugettext_lazy('This is the program for GSoC 2009')
+
+  #: Required 1:1 relationship indicating the Program the Timeline
+  #: belongs to.
+  timeline = db.ReferenceProperty(reference_class=soc.models.timeline.Timeline,
+                                 required=True, collection_name="program",
+                                 verbose_name=ugettext_lazy('Timeline'))
--- a/app/soc/models/timeline.py	Tue Jan 06 16:01:16 2009 +0000
+++ b/app/soc/models/timeline.py	Tue Jan 06 16:55:27 2009 +0000
@@ -25,18 +25,13 @@
 
 from django.utils.translation import ugettext_lazy
 
-import soc.models.program
+from soc.models import base
 
-class Timeline(soc.models.timeline.Timeline):
+
+class Timeline(base.ModelWithFieldAttributes):
   """The Timeline Model, representing the timeline for a Program.
   """
 
-  #: Required 1:1 relationship indicating the Program the Timeline
-  #: belongs to.
-  program = db.ReferenceProperty(reference_class=soc.models.program.Program,
-                                 required=True, collection_name="timeline",
-                                 verbose_name=ugettext_lazy('Timeline'))
-
   program_start_data = db.DateTimeProperty(
       verbose_name=ugettext_lazy('Program Start date'))