forms foo lil bit..
This commit is contained in:
parent
40f401b547
commit
82952672ed
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<span class="orange">Nature of Work: </span>
|
||||
<ul>
|
||||
{% for work in nature_of_work %}
|
||||
<li>{{ work.name }} <br /> {{ work.name }} </li>
|
||||
<li>{{ work.name }} {% if work.is_main %} Primary occupation {% endif %} </li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -64,7 +64,10 @@
|
|||
<span class="orange">Trainings: </span>
|
||||
<ul>
|
||||
{% for training in trainings %}
|
||||
<li>{{ training }} </li>
|
||||
<li>{{ training }} {{ training.title }} {{ training.desc }} {{ training.person }} {{ training.area }} {{ training.with_whom }} {{ training.where }} {{ training.from_when }} {{ training.until_when }}
|
||||
{% for loc in training.locations %} {{ loc.city }} {% endfor %}
|
||||
</li>
|
||||
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -76,7 +79,7 @@
|
|||
<span class="orange">Venues: </span>
|
||||
<ul>
|
||||
{% for elem in venues %}
|
||||
<li> {{ elem.name }} </li>
|
||||
<li> {{ elem.city }} </li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -89,7 +92,13 @@
|
|||
|
||||
<ul>
|
||||
{% for elem in buzzitems %}
|
||||
<li>{{ elem }} </li>
|
||||
<li>
|
||||
<a href={{ elem.link }}> {{ elem.title }} </a>
|
||||
<br/>
|
||||
Desc: {{ elem.blurb }}
|
||||
<br/>
|
||||
Type:{{ elem.typ }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user