5
5
from django .db .models import F
6
6
from django .http import HttpResponseRedirect
7
7
8
- from django_object_actions import (DjangoObjectActions ,
9
- takes_instance_or_queryset )
8
+ from django_object_actions import (
9
+ DjangoObjectActions , takes_instance_or_queryset )
10
10
11
11
from .models import Choice , Poll , Comment
12
12
@@ -42,8 +42,10 @@ def edit_poll(self, request, obj):
42
42
def raise_key_error (self , request , obj ):
43
43
raise KeyError
44
44
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
+ )
47
49
actions = ['increment_vote' ]
48
50
49
51
admin .site .register (Choice , ChoiceAdmin )
@@ -57,7 +59,8 @@ class ChoiceInline(admin.StackedInline):
57
59
class PollAdmin (DjangoObjectActions , admin .ModelAdmin ):
58
60
fieldsets = [
59
61
(None , {'fields' : ['question' ]}),
60
- ('Date information' , {'fields' : ['pub_date' ], 'classes' : ['collapse' ]}),
62
+ ('Date information' ,
63
+ {'fields' : ['pub_date' ], 'classes' : ['collapse' ]}),
61
64
]
62
65
inlines = [ChoiceInline ]
63
66
list_display = ('question' , 'pub_date' , 'was_published_recently' )
@@ -74,7 +77,8 @@ def delete_all_choices(self, request, obj):
74
77
return
75
78
76
79
self .message_user (request , 'All choices deleted' )
77
- return render_to_response ('clear_choices.html' ,
80
+ return render_to_response (
81
+ 'clear_choices.html' ,
78
82
dict (object = obj ), context_instance = RequestContext (request ))
79
83
delete_all_choices .label = "Delete All Choices"
80
84
0 commit comments