1 from datetime import datetime |
1 from datetime import datetime |
2 |
2 |
3 from django.contrib.auth.models import User, UserManager |
3 from django.contrib.auth.models import User |
|
4 from django.contrib.auth.models import UserManager |
4 from django.db import models |
5 from django.db import models |
5 from django.forms import ModelForm |
6 from django.forms import ModelForm |
6 from django.utils.translation import ugettext_lazy as _ |
7 from django.utils.translation import ugettext_lazy as _ |
7 |
8 |
8 |
9 |
9 class Participant(models.Model): |
10 class Participant(models.Model): |
10 """Model for holding details of participants |
11 """Model for holding details of participants |
11 """ |
12 """ |
12 |
13 |
|
14 # This is the only required field |
|
15 user = models.ForeignKey(User, unique=True) |
|
16 |
13 PARTICIPANT_CATEGORY = ( |
17 PARTICIPANT_CATEGORY = ( |
14 ('Student','Student'), |
18 ('Student','Student'), |
15 ('Corporate Staff','Corporate Staff'), |
19 ('Corporate Staff','Corporate Staff'), |
16 ('Teacher','Teacher'), |
20 ('Teacher','Teacher'), |
17 ('Others','Others'), |
21 ('Others','Others'), |
18 ) |
22 ) |
19 |
23 |
20 username = models.ForeignKey(User, unique=True, related_name='profile') |
24 category = models.CharField(max_length=80, choices=PARTICIPANT_CATEGORY) |
21 |
25 |
22 email = models.EmailField(_("Email Address"),unique=True) |
26 organisation = models.CharField(_("Organisation"), max_length=200, |
23 |
27 blank = True, null=True) |
24 category = models.CharField(max_length = 80, choices=PARTICIPANT_CATEGORY,) |
|
25 |
28 |
26 organisation = models.CharField(_("Organisation"),max_length=200,blank = True,null = True) |
29 attending_conf = models.BooleanField(verbose_name="Will you attend the conference?") |
27 |
30 |
28 attending_conf = models.BooleanField(verbose_name="Will you attend conference?") |
31 attending_tut = models.BooleanField(verbose_name="Will you attend the tutorial session?") |
29 |
32 |
30 attending_tut = models.BooleanField(verbose_name="Will you attend tutorial session?") |
33 attending_sprint = models.BooleanField(verbose_name="Will you attend the sprint?") |
31 |
34 |
32 attending_sprint = models.BooleanField(verbose_name="Will you attend sprint?") |
35 paper_submission = models.BooleanField(verbose_name="Do you want to Submit paper(s)?") |
33 |
|
34 paper_submission = models.BooleanField(verbose_name="Do you want to Submit paper?") |
|