From 847d968032ae3d25f5babfddf0687b03b36e5a58 Mon Sep 17 00:00:00 2001 From: Johnson Chetty Date: Wed, 22 Aug 2012 18:20:07 +0200 Subject: [PATCH] TheatreGroup model, template and getdict done. Major db change. db migration script added --- itf/itfprofiles/admin.py | 4 + itf/itfprofiles/models.py | 22 +-- .../modules/itfprofiles/theatregroup.html | 134 +++++++++++++++++- 3 files changed, 143 insertions(+), 17 deletions(-) diff --git a/itf/itfprofiles/admin.py b/itf/itfprofiles/admin.py index 9bd73a7..6fb5871 100755 --- a/itf/itfprofiles/admin.py +++ b/itf/itfprofiles/admin.py @@ -43,6 +43,10 @@ admin.site.register(Occupation, OccupationAdmin) admin.site.register(Relation, RelationAdmin) admin.site.register(TheatreGroup, TheatreGroupAdmin) admin.site.register(Person) +admin.site.register(Language) +admin.site.register(Training) +admin.site.register(Production) + #class TalkAdmin(admin.ModelAdmin): # inlines = [PadmaVideoInline, AudioInline, ImageInline, DocumentInline] # save_on_top = True diff --git a/itf/itfprofiles/models.py b/itf/itfprofiles/models.py index 5104cf7..45b0af0 100644 --- a/itf/itfprofiles/models.py +++ b/itf/itfprofiles/models.py @@ -229,15 +229,14 @@ class TheatreGroup(ItfModel): website = models.URLField(blank=True, verify_exists=False) resources = models.ManyToManyField("Resource", blank=True, null=True) locations = generic.GenericRelation("Location"), -# locations = models.ManyToManyField("Location", blank=True, null=True, related_name="theatregroup_locations") nature_of_work = models.ManyToManyField("GroupOccupation", blank=True, null=True, through="GroupGroupOccupation") +# locations = models.ManyToManyField("Location", blank=True, null=True, related_name="theatregroup_locations") + about = models.TextField(blank=True, null=True) #nature_of_work = models.CharField(max_length=255) founded = models.CharField(max_length=10) trainings = models.ManyToManyField("Training", blank=True, null=True) - - def __unicode__(self): return self.name @@ -248,17 +247,18 @@ class TheatreGroup(ItfModel): 'tel':self.tel, 'nature_of_work': [ obj for obj in self.nature_of_work.all().order_by('groupgroupoccupation__is_main')], 'venues': [obj for obj in self.locations], - 'trainings': [obj for obj in self.trainings_set.all()], - 'languages': [obj.name for obj in self.languages], + 'trainings': [obj for obj in self.trainings.all()], + 'languages': [obj.name for obj in self.languages.all()], 'venues': [obj for obj in self.locations], - 'founded': year_founded, + 'founded': self.year_founded, 'about': self.about, - 'awards': [obj for obj in self.awards], + 'awards': [obj for obj in self.awards.all()], 'website': self.website, - 'resources': [obj for obj in self.resources], - 'buzzitems': [obj for obj in self.buzzitems], - 'productions': [obj for obj in self.productions_set.all() ], - 'scripts': [obj for obj in self.scripts_set.all() ], + 'resources': [obj for obj in self.resources.all()], + 'buzzitems': [obj for obj in self.buzzitems.all()], + 'productions': [obj for obj in self.production_set.all() ], + 'scripts': [obj for obj in self.script_set.all() ], + 'people' : [obj for obj in self.person_set.all() ], } def get_title(self): diff --git a/itf/templates/modules/itfprofiles/theatregroup.html b/itf/templates/modules/itfprofiles/theatregroup.html index 837152c..0e3345e 100644 --- a/itf/templates/modules/itfprofiles/theatregroup.html +++ b/itf/templates/modules/itfprofiles/theatregroup.html @@ -10,47 +10,169 @@
- +

{{ name }}

+ A brief bio and a history of work. should be able to add photos here + + + {% if email %} +
+ {{ email }} +
+ {% endif %} + + + {% if tel %} +
+ {{ tel }} +
+ {% endif %} + + {% if founded %} +
+ {{ founded }} +
+ {% endif %} + + {% if website %} +
+ {{ website }} +
+ {% endif %} + + {% if about %}
{{ about }}
{% endif %} - - {% if nature_of_work %}
+
    {% for work in nature_of_work %} - - {{ work }} : {{ work.is_main }} - +
  • {{ work }}
  • {% endfor %} +
{% endif %} + + {% if trainings %} +
+ Trainings: +
    + {% for training in trainings %} +
  • {{ training }}
  • + {% endfor %} +
+
+ {% endif %} + + + {% if venues %} +
+
    + {% for elem in venues %} +
  • {{ elem.name }}
  • + {% endfor %} +
+
+ {% endif %} + + + {% if buzzitems %} +
+
    + {% for elem in buzzitems %} +
  • {{ elem }}
  • + {% endfor %} +
+
+ {% endif %} + + + +
Active Members, Associates, (Fans? - maybe this is a link with a list popout, so they are not perceived as internal to the group). Photos of users on site should show up. We must SEE the community. Noel needs to send a design for tha tab, which will be used across all "People" tabs. + + {% if people %} +
+
    + {% for person in people %} +
  • {{ person }}
  • + {% endfor %} +
+
+ {% endif %} +
Title of each production links to "Productions" page. + + {% if productions %} +
+
    + {% for prod in productions %} +
  • {{ prod }}
  • + {% endfor %} +
+
+ {% endif %} +
books, CDs, DVDs, scripts - anything the group owns. This can be images, text or links. backend - user should be asked to label the item. Optional + + + {% if resources %} +
+
    + {% for elem in resources %} +
  • {{ elem }}
  • + {% endfor %} +
+
+ {% endif %} + +
Anything about the group (annotations & anecdotes in a sense). Anybody can add. These are scripts owned by the group. i.e the group is the author. + + {% if scripts %} +
+
    + {% for elem in scripts %} +
  • {{ elem }}
  • + {% endfor %} +
+
+ {% endif %} + +