summaryrefslogtreecommitdiff
path: root/postgresqleu/elections/admin.py
diff options
context:
space:
mode:
authorMagnus Hagander2018-12-14 14:43:56 +0000
committerMagnus Hagander2018-12-14 15:31:28 +0000
commit7dea97f90b534f71cbec6d0e5dfbdf237403b1f1 (patch)
tree48c53ef74987f68c05f12fb1e97b02f25a13e45a /postgresqleu/elections/admin.py
parente0bfd4f892e43db89bc996c1474f59c2dd6a8dc6 (diff)
Fix blankline related warnings
Diffstat (limited to 'postgresqleu/elections/admin.py')
-rw-r--r--postgresqleu/elections/admin.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/postgresqleu/elections/admin.py b/postgresqleu/elections/admin.py
index fc66fb5c..10d6997d 100644
--- a/postgresqleu/elections/admin.py
+++ b/postgresqleu/elections/admin.py
@@ -3,6 +3,7 @@ from django.forms import ValidationError, ModelForm
from models import Vote, Election, Candidate
+
class VoteAdminForm(ModelForm):
class Meta:
model = Vote
@@ -11,6 +12,7 @@ class VoteAdminForm(ModelForm):
def clean(self):
raise ValidationError("You really shouldn't edit votes! If you *really* need to fix something broken, do it in the db")
+
class VoteAdmin(admin.ModelAdmin):
list_display = ('election', 'voter', 'candidate', 'score')
ordering = ['election', ]
@@ -21,11 +23,13 @@ class ElectionAdmin(admin.ModelAdmin):
list_display = ['name', 'startdate', 'enddate', ]
ordering = ['-startdate', ]
+
class CandidateAdmin(admin.ModelAdmin):
list_display = ['name', 'election', ]
list_filter = ['election', ]
ordering = ['name', ]
+
admin.site.register(Election, ElectionAdmin)
admin.site.register(Candidate, CandidateAdmin)
admin.site.register(Vote, VoteAdmin)