@ -24,12 +24,13 @@ class Person(ItfModel):
first_name = models . CharField ( max_length = 255 )
last_name = models . CharField ( max_length = 255 )
email = models . EmailField ( blank = True , null = True , unique = True , db_index = True )
tel_no = models . CharField ( max_length = 100 , blank = True )
about = models . TextField ( blank = True , null = True )
tel_no = models . CharField ( max_length = 100 , blank = True , verbose_name = ' Telephone number ' )
is_practitioner = models . BooleanField ( default = False , verbose_name = ' Are you a theatre practitioner? ' )
is_freelancer = models . BooleanField ( default = False , verbose_name = ' Are you a theatre associate? ' ) #Change to is_associate
is_enthusiast = models . BooleanField ( default = True , verbose_name = ' Are you a theatre enthusiast? ' )
about = models . TextField ( blank = True , null = True , verbose_name = ' About yourself ' )
dob = models . DateField ( null = True , verbose_name = " Date of Birth " , blank = True )
is_practitioner = models . BooleanField ( default = False )
is_enthusiast = models . BooleanField ( default = True )
is_freelancer = models . BooleanField ( default = False ) #Change to is_associate
#Occupation info
occupations = models . ManyToManyField ( " Occupation " , through = ' PersonOccupation ' , blank = True , null = True )
@ -43,7 +44,7 @@ class Person(ItfModel):
groups = models . ManyToManyField ( " TheatreGroup " , blank = True , null = True , through = ' PersonGroup ' )
connections = models . ManyToManyField ( ' Person ' , blank = True , null = True , through = ' PersonPerson ' )
productions = models . ManyToManyField ( " Production " , blank = True , null = True , through = ' PersonProduction ' )
trainings = models . ManyToManyField ( " Training " , blank = True , null = True , related_name = " trainee " )
trainings = generic . GenericRelation ( " Training " , related_name = ' Trainee ' )
# awards = models.ManyToManyField("Award", blank=True, null=True)
languages = models . ManyToManyField ( " Language " , blank = True , null = True ) #s added
awards = generic . GenericRelation ( " Award " )
@ -220,6 +221,9 @@ class Training(models.Model):
from_when = models . DateField ( blank = True , null = True )
until_when = models . DateField ( blank = True , null = True )
locations = generic . GenericRelation ( " Location " )
content_type = models . ForeignKey ( ContentType )
object_id = models . PositiveIntegerField ( )
content_object = generic . GenericForeignKey ( ' content_type ' , ' object_id ' )
def __unicode__ ( self ) :
return self . area
@ -240,10 +244,10 @@ class TheatreGroup(ItfModel):
form_names = [ ' TheatreGroupForm ' , ' PopupGroupForm ' ]
main_form = ' TheatreGroupForm '
added_by = models . ForeignKey ( User )
name = models . CharField ( max_length = 255 , db_index = True ) # name + location is unique
name = models . CharField ( max_length = 255 , db_index = True , help_text = ' Name of theatre group ' ) # name + location is unique
email = models . EmailField ( blank = True , null = True )
# location = models.ForeignKey(Location, blank=True, null=True, related_name="theatregroup_location")
tel = models . IntegerField ( blank = True , null = True )
tel = models . IntegerField ( blank = True , null = True , verbose_name = ' Telephone number ' )
# -- FIXME tel = models.CharField(blank=True, null=True)
languages = models . ManyToManyField ( " Language " , blank = True , null = True )
@ -252,7 +256,7 @@ class TheatreGroup(ItfModel):
awards = generic . GenericRelation ( " Award " )
buzzitems = generic . GenericRelation ( " BuzzItem " )
website = models . URLField ( blank = True , verify_exists = False )
resources = models . ManyToManyField ( " Resource " , blank = True , null = True )
resources = generic . GenericRelation ( " Resource " )
locations = generic . GenericRelation ( " Location " )
# albums = generic.GenericRelation(Album)
nature_of_work = models . ManyToManyField ( " GroupOccupation " , blank = True , null = True , through = " GroupGroupOccupation " )
@ -260,8 +264,8 @@ class TheatreGroup(ItfModel):
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 )
# founded = models.CharField(max_length=10 )
trainings = generic . GenericRelation ( " Training " )
def __unicode__ ( self ) :
return self . name
@ -293,10 +297,12 @@ class TheatreGroup(ItfModel):
class Resource ( models . Model ) :
title = models . CharField ( max_length = 255 , blank = True )
desc = models . TextField ( max_length = 10000 , blank = True , null = True , help_text = " Optional Description, 500 words or less " )
fil = models . FileField ( upload_to = ' upload/docs ' , blank = True , null = True )
fil = models . FileField ( upload_to = ' upload/docs ' , blank = True , null = True , verbose_name = ' File ' )
url = models . URLField ( blank = True , null = True , verify_exists = True )
thumbnail = models . ImageField ( upload_to = ' uploads/docs ' , blank = True , null = True )
content_type = models . ForeignKey ( ContentType )
object_id = models . PositiveIntegerField ( )
content_object = generic . GenericForeignKey ( ' content_type ' , ' object_id ' )
from scriptbank . models import Script
@ -314,6 +320,7 @@ class Production(ItfModel):
director = models . ForeignKey ( Person , related_name = ' productions_directed ' , blank = True , null = True )
playwright = models . ForeignKey ( Person , related_name = ' productions_authored ' , blank = True , null = True )
anecdotes = models . TextField ( blank = True )
awards = generic . GenericRelation ( " Award " )
def __unicode__ ( self ) :
return self . name
@ -380,8 +387,8 @@ class GroupOccupation(models.Model):
class GroupGroupOccupation ( models . Model ) :
theatregroup = models . ForeignKey ( " TheatreGroup " )
groupoccupation = models . ForeignKey ( " GroupOccupation " )
is_main = models . BooleanField ( default = False )
groupoccupation = models . ForeignKey ( " GroupOccupation " , verbose_name = " Occupation " )
is_main = models . BooleanField ( default = False , verbose_name = " Is this the group ' s main occupation? " )