From 82952672ed13708907c277cb7620c0f9385e5748 Mon Sep 17 00:00:00 2001 From: Johnson Chetty Date: Fri, 31 Aug 2012 14:25:04 +0200 Subject: [PATCH] forms foo lil bit.. --- itf/itfprofiles/forms.py | 3 ++- itf/itfprofiles/models.py | 9 ++++++--- .../modules/itfprofiles/theatregroup.html | 17 +++++++++++++---- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/itf/itfprofiles/forms.py b/itf/itfprofiles/forms.py index c1aada0..3278ae1 100644 --- a/itf/itfprofiles/forms.py +++ b/itf/itfprofiles/forms.py @@ -10,7 +10,7 @@ from crispy_forms.layout import Submit from django.contrib.contenttypes.models import ContentType from app.forms import * from imagestore.forms import AlbumForm, ImageForm - +from itfprofiles.models import * #Forms and Inlines for Generic Classes @@ -24,6 +24,7 @@ class LocationForm(ItfForm): class Meta: model = Location + #fields = ('city','address', 'pincode') exclude = ('lat', 'lon',) LocationsInline = itf_inlineformset_factory(Location, form=LocationForm, title="Locations", is_generic=True) diff --git a/itf/itfprofiles/models.py b/itf/itfprofiles/models.py index 3178333..9669e84 100644 --- a/itf/itfprofiles/models.py +++ b/itf/itfprofiles/models.py @@ -106,7 +106,7 @@ class BuzzItem(ItfModel): link = models.URLField(verify_exists=False) title = models.CharField(max_length=255) blurb = models.TextField(blank=True) - typ = models.CharField(choices=BUZZ_ITEM_TYPES, max_length=128, blank=True) + typ = models.CharField(choices=BUZZ_ITEM_TYPES, max_length=128, blank=True, verbose_name="Type") content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField() content_object = generic.GenericForeignKey('content_type', 'object_id') @@ -201,8 +201,8 @@ class Training(models.Model): until_when = models.DateField(blank=True, null=True) locations = generic.GenericRelation("Location") - #def __unicode__(self): - #\ return self.name + def __unicode__(self): + return self.area class Play(ItfModel): @@ -369,3 +369,6 @@ class Language(models.Model): code = models.CharField(max_length=3, db_index=True) name = models.CharField(max_length=255) + def __unicode__(self): + return self.name + diff --git a/itf/templates/modules/itfprofiles/theatregroup.html b/itf/templates/modules/itfprofiles/theatregroup.html index 9b83021..e02c277 100644 --- a/itf/templates/modules/itfprofiles/theatregroup.html +++ b/itf/templates/modules/itfprofiles/theatregroup.html @@ -52,7 +52,7 @@ Nature of Work: @@ -64,7 +64,10 @@ Trainings: @@ -76,7 +79,7 @@ Venues: @@ -89,7 +92,13 @@