Skip to content

Instantly share code, notes, and snippets.

@neara
Created October 30, 2012 08:18

Revisions

  1. neara revised this gist Oct 30, 2012. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions models.py
    Original file line number Diff line number Diff line change
    @@ -6,3 +6,7 @@ class Occupation(models.Model):

    def __unicode__(self):
    return self.section.name

    class OccupationForm(forms.ModelForm):
    class Meta:
    model = Occupation
  2. neara created this gist Oct 30, 2012.
    8 changes: 8 additions & 0 deletions models.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    class Occupation(models.Model):
    event = models.ForeignKey(Event, related_name='sections')
    section = models.ForeignKey(Section)
    expected_capacity = models.PositiveIntegerField(
    help_text='Max Capacity: %d' % self.section.crowd_capacity)

    def __unicode__(self):
    return self.section.name