author | nishanth |
Thu, 08 Apr 2010 22:28:15 +0530 | |
changeset 2 | c11afa8623f7 |
parent 1 | 18dc0362f550 |
child 6 | 057498d12450 |
permissions | -rw-r--r-- |
0 | 1 |
from django.db import models |
2 |
from django.contrib.auth.models import User |
|
3 |
||
4 |
GENDER_CHOICES = (('M', "Male"), |
|
5 |
('F', 'Female')) |
|
6 |
||
7 |
PROFESSION_CHOICES = (('S', 'Student'), |
|
8 |
('F', 'Faculty'), |
|
9 |
('P', 'Professional')) |
|
10 |
||
11 |
||
12 |
class Profile(models.Model): |
|
13 |
""" A model to hold extra information about the user. |
|
14 |
""" |
|
15 |
||
2 | 16 |
key = models.CharField(max_length=10, unique=True) |
17 |
||
0 | 18 |
user = models.ForeignKey(User, unique=True) |
19 |
gender = models.CharField(max_length=1, choices=GENDER_CHOICES) |
|
20 |
profession = models.CharField(max_length=1, choices=PROFESSION_CHOICES) |
|
21 |
affiliated_to = models.CharField(max_length=100, verbose_name="College/Company") |
|
22 |
interests = models.CharField(max_length=100, verbose_name="Fields of Interest", |
|
23 |
help_text="Ex: Python, Image Processing, Bio Informatics etc.") |
|
24 |
||
2 | 25 |
activation_key = models.CharField(max_length=30, unique=True) |
26 |
||
0 | 27 |
class Event(models.Model): |
28 |
""" A model for the workshop information. |
|
29 |
""" |
|
30 |
||
2 | 31 |
key = models.CharField(max_length=10, unique=True) |
32 |
||
0 | 33 |
title = models.CharField(max_length=100) |
34 |
description = models.TextField() |
|
35 |
start_date = models.DateField() |
|
2 | 36 |
stop_date = models.DateField() |
0 | 37 |
attendees = models.ManyToManyField(User, related_name="%(class)s_attendees") |
38 |
organizers = models.ManyToManyField(User, related_name="%(class)s_organizers") |
|
39 |
||
1
18dc0362f550
app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents:
0
diff
changeset
|
40 |
feedback_open = models.BooleanField() |
18dc0362f550
app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents:
0
diff
changeset
|
41 |
quiz_open = models.BooleanField() |