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