Skip to content

Instantly share code, notes, and snippets.

@nonZero
Forked from neara/models.py
Created October 30, 2012 08:37
Show Gist options
  • Save nonZero/3979016 to your computer and use it in GitHub Desktop.
Save nonZero/3979016 to your computer and use it in GitHub Desktop.
class Occupation(models.Model):
event = models.ForeignKey(Event, related_name='sections')
section = models.ForeignKey(Section)
expected_capacity = models.PositiveIntegerField(
help_text=)
def __unicode__(self):
return self.section.name
class OccupationForm(forms.ModelForm):
class Meta:
model = Occupation
def __init__(self, *args, **kwargs):
super(OccupationForm, self).__init__(*args, **kwargs)
self.fields['expected_capacity '].help_text = 'Max Capacity: %d' % self.instance.section.crowd_capacity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment