summaryrefslogtreecommitdiffstats
path: root/polls/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'polls/models.py')
-rwxr-xr-xpolls/models.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/polls/models.py b/polls/models.py
deleted file mode 100755
index f8a1b17..0000000
--- a/polls/models.py
+++ /dev/null
@@ -1,35 +0,0 @@
-from django.db import models
-
-# Create your models here.
-
-class Poll(models.Model):
- def __unicode__(self):
- return self.question
- question = models.CharField(max_length=200)
- pub_date = models.DateTimeField('date published')
-
-class Choice(models.Model):
- def __unicode__(self):
- return self.choice
- poll = models.ForeignKey(Poll)
- choice = models.CharField(max_length=200)
- votes = models.IntegerField()
-
-from django.contrib import admin
-
-class ChoiceInline(admin.TabularInline):
- model = Choice
- extra = 3
-
-class PollAdmin(admin.ModelAdmin):
- list_display = ('question', 'pub_date')
- list_filter = ['pub_date']
- search_fields = ['question']
- date_hierarchy = 'pub_date'
- fieldsets = [
- (None, {'fields': ['question']}),
- ('Date information', {'fields': ['pub_date'], 'classes': ['collapse']}),
- ]
- inlines = [ChoiceInline]
-
-admin.site.register(Poll, PollAdmin)