project/scipycon/base/models.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Tue, 20 Jul 2010 03:20:02 +0530
changeset 110 627cd08619ee
parent 104 1a83a26756c3
child 116 5191e1134082
permissions -rw-r--r--
Added timeline and event models and readjusted ScopedBase model.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
110
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
     2
from django.core.management.validation import max_length
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
     3
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
     4
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
     5
class Event(models.Model):
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
     6
    """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
     7
    """
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
     8
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
     9
    # 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
    10
    STATUS_CHOICES = (
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    11
        ('active', 'Active'),
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    12
        ('inactive', 'Inactive'),
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    13
    )
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    14
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    15
    # 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
    16
    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
    17
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    18
    # Name of the program
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    19
    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
    20
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    21
    # 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
    22
    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
    23
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    24
    # 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
    25
    timeline = models.OneToOneField(Timeline)
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    26
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    27
    # Status of the program
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    28
    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
    29
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    30
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    31
class Timeline(models.Model):
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    32
    """Timeline of the program
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    33
    """
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    34
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    35
    # Start of registration for the program
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    36
    registration_start = models.DateTimeField()
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    37
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    38
    # End of registration for the program
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    39
    registration_end = models.DateTimeField()
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    40
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    41
    # Start of Call for Papers
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    42
    cfp_start = models.DateTimeField()
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    43
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    44
    # End of Call for Papers
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    45
    cfp_end = models.DateTimeField()
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    46
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    47
    # Accepted papers announced
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    48
    accepted_papers_announced = models.DateTimeField()
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    49
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    50
    # Deadline to submit proceedings paper
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    51
    proceedings_paper_deadline = models.DateTimeField()
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    52
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    53
    # Start of the actual program
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    54
    event_start = models.DateTimeField()
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    55
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    56
    # End of the actual program
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    57
    event_end = models.DateTimeField()
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
    58
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
    59
104
1a83a26756c3 Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 101
diff changeset
    60
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
    61
    """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
    62
    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
    63
    """
104
1a83a26756c3 Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 101
diff changeset
    64
110
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    65
    # Scope of entity in which it is visible
627cd08619ee Added timeline and event models and readjusted ScopedBase model.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
    66
    scope = models.ForeignKey(Scope)
104
1a83a26756c3 Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 101
diff changeset
    67
1a83a26756c3 Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 101
diff changeset
    68
    class Meta:
1a83a26756c3 Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 101
diff changeset
    69
        abstract = True