| 1 | == in progress == |
| 2 | |
| 3 | {{{ |
| 4 | from django.db import models |
| 5 | |
| 6 | class Individual (models.Model): |
| 7 | #... |
| 8 | class Admin: pass |
| 9 | |
| 10 | class Event (models.Model): |
| 11 | #... |
| 12 | class Admin: pass |
| 13 | |
| 14 | class Participation (models.Model): |
| 15 | # leave defaults: null=False , core=False |
| 16 | event = models.ForeignKey(Event, related_name='participants', edit_inline=True, blank=True, default=None) |
| 17 | individual = models.ForeignKey(Individual, related_name='events', edit_inline=True, blank=True, default=None) |
| 18 | # set core=True and blank=True: now admin will show it blank by default (so it won't exist unless you specify something) |
| 19 | role = models.PositiveSmallIntegerField(core=True, blank=True, default=None) |
| 20 | class Admin: pass |
| 21 | }}} |