Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

three quarters the way through 02

  • Loading branch information...
commit e7017ababc7e3e6250320e1a490c9084cce20894 1 parent e5b979e
@swmcc authored
View
BIN  mysite/settings.pyc
Binary file not shown
View
2  polls/admin.py
@@ -13,5 +13,7 @@ class QuestionAdmin(admin.ModelAdmin):
]
inlines = [ChoiceInline]
list_display = ('question_text', 'pub_date', 'was_published_recently')
+ list_filter = ['pub_date']
+ search_fields = ['question_text']
admin.site.register(Question, QuestionAdmin)
View
BIN  polls/admin.pyc
Binary file not shown
View
4 polls/models.py
@@ -11,7 +11,9 @@ def __unicode__(self):
def was_published_recently(self):
return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
-
+ was_published_recently.admin_order_field = 'pub_date'
+ was_published_recently.boolean = True
+ was_published_recently.short_description = 'Published recently?'
class Choice(models.Model):
question = models.ForeignKey(Question)
View
BIN  polls/models.pyc
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.