author | nishanth |
Fri, 09 Apr 2010 15:35:40 +0530 | |
changeset 6 | 057498d12450 |
parent 2 | c11afa8623f7 |
child 8 | e2699e042129 |
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 |
||
16 |
user = models.ForeignKey(User, unique=True) |
|
17 |
gender = models.CharField(max_length=1, choices=GENDER_CHOICES) |
|
18 |
profession = models.CharField(max_length=1, choices=PROFESSION_CHOICES) |
|
19 |
affiliated_to = models.CharField(max_length=100, verbose_name="College/Company") |
|
20 |
interests = models.CharField(max_length=100, verbose_name="Fields of Interest", |
|
21 |
help_text="Ex: Python, Image Processing, Bio Informatics etc.") |
|
22 |
||
2 | 23 |
activation_key = models.CharField(max_length=30, unique=True) |
24 |
||
0 | 25 |
class Event(models.Model): |
26 |
""" A model for the workshop information. |
|
27 |
""" |
|
28 |
||
2 | 29 |
key = models.CharField(max_length=10, unique=True) |
30 |
||
0 | 31 |
title = models.CharField(max_length=100) |
32 |
description = models.TextField() |
|
33 |
start_date = models.DateField() |
|
2 | 34 |
stop_date = models.DateField() |
0 | 35 |
attendees = models.ManyToManyField(User, related_name="%(class)s_attendees") |
36 |
organizers = models.ManyToManyField(User, related_name="%(class)s_organizers") |
|
37 |
||
1
18dc0362f550
app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents:
0
diff
changeset
|
38 |
feedback_open = models.BooleanField() |
18dc0362f550
app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents:
0
diff
changeset
|
39 |
quiz_open = models.BooleanField() |
6
057498d12450
users can now register but still there is no concept of activation e-mail .
nishanth
parents:
2
diff
changeset
|
40 |
|
057498d12450
users can now register but still there is no concept of activation e-mail .
nishanth
parents:
2
diff
changeset
|
41 |
def __unicode__(self): |
057498d12450
users can now register but still there is no concept of activation e-mail .
nishanth
parents:
2
diff
changeset
|
42 |
|
057498d12450
users can now register but still there is no concept of activation e-mail .
nishanth
parents:
2
diff
changeset
|
43 |
return self.title |