diff options
author | Parth Buch | 2012-08-28 17:03:37 +0530 |
---|---|---|
committer | Parth Buch | 2012-08-28 17:03:37 +0530 |
commit | 7e38fd922a8dd4742d09758cd1c94fb0302045d3 (patch) | |
tree | b43d6ea8c47fb80e09e5e0bfd8759ac7d697addf /project/scipycon/talk/models.py | |
download | scipywebsite-7e38fd922a8dd4742d09758cd1c94fb0302045d3.tar.gz scipywebsite-7e38fd922a8dd4742d09758cd1c94fb0302045d3.tar.bz2 scipywebsite-7e38fd922a8dd4742d09758cd1c94fb0302045d3.zip |
Reboot for scipy 2012
Diffstat (limited to 'project/scipycon/talk/models.py')
-rw-r--r-- | project/scipycon/talk/models.py | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/project/scipycon/talk/models.py b/project/scipycon/talk/models.py new file mode 100644 index 0000000..82c8f25 --- /dev/null +++ b/project/scipycon/talk/models.py @@ -0,0 +1,57 @@ +from django.db import models +from django.contrib.auth.models import User + +from tagging import register +from tagging.fields import TagField +from tagging.utils import parse_tag_input + +from project.scipycon.base import models as base_models + + +DURATION_CHOICES = ( + ('10', 'Lightning Talk (10 mins)'), + ('20', 'Short Talk (20 mins)'), + ('30', 'Standard Talk (30 mins)'), + ) + +AUDIENCE_CHOICES = ( + ('nonprogrammers', 'Non Programmer'), + ('beginers', 'Beginner Programmer'), + ('intermediate', 'Intermediate Programmer'), + ('advanced', 'Advanced Programmer'), + ) + + +class Talk(base_models.ScopedBase): + """Defines talks at SciPy.in + """ + + slug = models.SlugField() + + speaker = models.ForeignKey(User) + + authors_bio = models.TextField() + + contact = models.EmailField() + + title = models.CharField(max_length=1024) + + abstract = models.TextField() + + topic = models.CharField(max_length=255, blank=True) + + duration = models.CharField(max_length=3, choices=DURATION_CHOICES) + + audience = models.CharField(max_length=32, choices=AUDIENCE_CHOICES, blank=True) + + approved = models.BooleanField(default=False) + + submitted = models.DateTimeField(auto_now_add=True) + + last_mod = models.DateTimeField(auto_now=True) + + def __unicode__(self): + return self.title + + def get_tag_list(self): + return parse_tag_input(self.tags) |