Mercurial > public > sg101
comparison gpp/polls/models.py @ 367:cb121a3abf46
Fixing #176; add a side block for current polls.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 05 Mar 2011 20:54:26 +0000 |
parents | dbd703f7d63a |
children | 1f139de929c4 |
comparison
equal
deleted
inserted
replaced
366:5219c7cc5a53 | 367:cb121a3abf46 |
---|---|
1 ''' | 1 """ |
2 Models for the Polls application. | 2 Models for the Polls application. |
3 ''' | |
4 | 3 |
4 """ | |
5 import datetime | 5 import datetime |
6 from django.db import models | 6 from django.db import models |
7 from django.db.models import Q | 7 from django.db.models import Q |
8 | 8 |
9 | 9 |
28 class Poll(models.Model): | 28 class Poll(models.Model): |
29 """Model to represent polls""" | 29 """Model to represent polls""" |
30 start_date = models.DateTimeField(db_index=True, | 30 start_date = models.DateTimeField(db_index=True, |
31 help_text='Date/time the poll will be eligible for voting.',) | 31 help_text='Date/time the poll will be eligible for voting.',) |
32 end_date = models.DateTimeField(blank=True, null=True, db_index=True, | 32 end_date = models.DateTimeField(blank=True, null=True, db_index=True, |
33 help_text='Date/time the poll will be ineligible for voting. '\ | 33 help_text='Date/time the poll will be ineligible for voting. ' |
34 'Leave blank for an open ended poll.') | 34 'Leave blank for an open ended poll.') |
35 is_enabled = models.BooleanField(default=True, db_index=True, | 35 is_enabled = models.BooleanField(default=True, db_index=True, |
36 help_text='Check to allow the poll to be viewed on the site.') | 36 help_text='Check to allow the poll to be viewed on the site.') |
37 question = models.CharField(max_length=200) | 37 question = models.CharField(max_length=200) |
38 | 38 |