55from django .db .models import F
66from django .http import HttpResponseRedirect
77
8- from django_object_actions import (DjangoObjectActions ,
9- takes_instance_or_queryset )
8+ from django_object_actions import (
9+ DjangoObjectActions , takes_instance_or_queryset )
1010
1111from .models import Choice , Poll , Comment
1212
@@ -42,8 +42,10 @@ def edit_poll(self, request, obj):
4242 def raise_key_error (self , request , obj ):
4343 raise KeyError
4444
45- objectactions = ('increment_vote' , 'decrement_vote' , 'reset_vote' ,
46- 'edit_poll' , 'raise_key_error' )
45+ objectactions = (
46+ 'increment_vote' , 'decrement_vote' , 'reset_vote' , 'edit_poll' ,
47+ 'raise_key_error' ,
48+ )
4749 actions = ['increment_vote' ]
4850
4951admin .site .register (Choice , ChoiceAdmin )
@@ -57,7 +59,8 @@ class ChoiceInline(admin.StackedInline):
5759class PollAdmin (DjangoObjectActions , admin .ModelAdmin ):
5860 fieldsets = [
5961 (None , {'fields' : ['question' ]}),
60- ('Date information' , {'fields' : ['pub_date' ], 'classes' : ['collapse' ]}),
62+ ('Date information' ,
63+ {'fields' : ['pub_date' ], 'classes' : ['collapse' ]}),
6164 ]
6265 inlines = [ChoiceInline ]
6366 list_display = ('question' , 'pub_date' , 'was_published_recently' )
@@ -74,7 +77,8 @@ def delete_all_choices(self, request, obj):
7477 return
7578
7679 self .message_user (request , 'All choices deleted' )
77- return render_to_response ('clear_choices.html' ,
80+ return render_to_response (
81+ 'clear_choices.html' ,
7882 dict (object = obj ), context_instance = RequestContext (request ))
7983 delete_all_choices .label = "Delete All Choices"
8084
0 commit comments