changes made for production, get_dict and model changes.. sql_diff file added for small change in models. template is fu^Ctional

This commit is contained in:
Johnson Chetty 2012-09-04 09:51:34 +02:00
parent f4c647837e
commit b00a26468f
3 changed files with 10 additions and 5 deletions

View File

@ -287,7 +287,7 @@ class TheatreGroup(ItfModel):
'website': self.website,
'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() ],
'productions': [obj for obj in self.productions.all() ],
'scripts': [obj for obj in self.script_set.all() ],
'people' : [obj for obj in self.person_set.all() ],
}
@ -322,7 +322,7 @@ class Production(ItfModel):
playwright = models.ForeignKey(Person, related_name='productions_authored', blank=True, null=True)
anecdotes = models.TextField(blank=True)
awards = generic.GenericRelation("Award")
debut_date = models.DateField(blank=True)
debut_date = models.DateField(blank=True, null=True)
reviews= generic.GenericRelation("BuzzItem")
def __unicode__(self):
@ -330,7 +330,7 @@ class Production(ItfModel):
def get_dict(self):
rel_level1 = [obj for obj in Production.objects.filter(script= self.script)]
rel_level2 = list(set(obj.productions_set.all() for obj in self.script.related_scripts.all()))
rel_level2 = list(set(obj.production_set.all() for obj in self.script.related_scripts.all()))
return {
'name': self.name,

View File

@ -1,6 +1,7 @@
DROP TABLE itfprofiles_production;
DROP TABLE itfprofiles_production_languages;
#DROP TABLE itfprofiles_award;
CREATE TABLE `itfprofiles_production_languages` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
@ -22,7 +23,7 @@ CREATE TABLE `itfprofiles_production` (
`director_id` integer,
`playwright_id` integer,
`anecdotes` longtext NOT NULL,
`debut_date` date NOT NULL
`debut_date` date
)
;
ALTER TABLE `itfprofiles_production` ADD CONSTRAINT `director_id_refs_id_9fefbcbd` FOREIGN KEY (`director_id`) REFERENCES `itfprofiles_person` (`id`);

View File

@ -0,0 +1,4 @@
ALTER TABLE `itfprofiles_production`
MODIFY `debut_date` date ;