author | Madhusudan.C.S <madhusudancs@gmail.com> |
Tue, 20 Jul 2010 15:46:27 +0530 | |
changeset 116 | 5191e1134082 |
parent 110 | 627cd08619ee |
child 124 | d62d301527b3 |
permissions | -rw-r--r-- |
101
61fc4aa7a09a
Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
1 |
from django.db import models |
116
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
2 |
|
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
3 |
|
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
4 |
class Timeline(models.Model): |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
5 |
"""Timeline of the program |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
6 |
""" |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
7 |
|
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
8 |
# Start of registration for the program |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
9 |
registration_start = models.DateTimeField(blank=True) |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
10 |
|
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
11 |
# End of registration for the program |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
12 |
registration_end = models.DateTimeField(blank=True) |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
13 |
|
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
14 |
# Start of Call for Papers |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
15 |
cfp_start = models.DateTimeField(blank=True) |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
16 |
|
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
17 |
# End of Call for Papers |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
18 |
cfp_end = models.DateTimeField(blank=True) |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
19 |
|
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
20 |
# Accepted papers announced |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
21 |
accepted_papers_announced = models.DateTimeField(blank=True) |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
22 |
|
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
23 |
# Deadline to submit proceedings paper |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
24 |
proceedings_paper_deadline = models.DateTimeField(blank=True) |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
25 |
|
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
26 |
# Start of the actual program |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
27 |
event_start = models.DateTimeField(blank=True) |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
28 |
|
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
29 |
# End of the actual program |
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
30 |
event_end = models.DateTimeField(blank=True) |
110
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
31 |
|
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
32 |
|
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
33 |
class Event(models.Model): |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
34 |
"""Data model which holds the data related to the scope or the event. |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
35 |
""" |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
36 |
|
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
37 |
# Different states the Event can be in |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
38 |
STATUS_CHOICES = ( |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
39 |
('active', 'Active'), |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
40 |
('inactive', 'Inactive'), |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
41 |
) |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
42 |
|
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
43 |
# Scope of the program, used as a URL prefix |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
44 |
scope = models.CharField(max_length=255) |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
45 |
|
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
46 |
# Name of the program |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
47 |
name = models.CharField(max_length=255) |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
48 |
|
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
49 |
# Event specific i.e version of the event |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
50 |
turn = models.CharField(max_length=255) |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
51 |
|
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
52 |
# Time associated with the program |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
53 |
timeline = models.OneToOneField(Timeline) |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
54 |
|
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
55 |
# Status of the program |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
56 |
status = models.CharField(max_length=255, choices=STATUS_CHOICES) |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
57 |
|
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
58 |
|
104
1a83a26756c3
Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
101
diff
changeset
|
59 |
class ScopedBase(models.Model): |
110
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
60 |
"""Base model which is in turn inherited by other models |
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
61 |
which needs to be scoped. |
101
61fc4aa7a09a
Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
62 |
""" |
104
1a83a26756c3
Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
101
diff
changeset
|
63 |
|
110
627cd08619ee
Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
104
diff
changeset
|
64 |
# Scope of entity in which it is visible |
116
5191e1134082
Moved Timeline model to the top of the file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
110
diff
changeset
|
65 |
scope = models.ForeignKey(Event) |
104
1a83a26756c3
Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
101
diff
changeset
|
66 |
|
1a83a26756c3
Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
101
diff
changeset
|
67 |
class Meta: |
1a83a26756c3
Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
101
diff
changeset
|
68 |
abstract = True |