Skip to content
This repository has been archived by the owner on Mar 2, 2019. It is now read-only.

Commit

Permalink
tollgate.frontend.admin PEP8, minor formatting changes to views.
Browse files Browse the repository at this point in the history
  • Loading branch information
micolous committed Jun 17, 2012
1 parent b5bd656 commit 5e78f3c
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 12 deletions.
56 changes: 45 additions & 11 deletions tollgate/frontend/admin.py
@@ -1,5 +1,7 @@
"""tollgate frontend admin hooks
Copyright 2008-2010 Michael Farrell
#!/usr/bin/env python
"""
tollgate frontend admin hooks
Copyright 2008-2012 Michael Farrell
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
Expand All @@ -18,36 +20,68 @@
from django.contrib import admin
from tollgate.frontend.models import *


class EventAttendanceAdmin(admin.ModelAdmin):
list_display = ("event", "user_profile", "quota_used", "quota_multiplier", "quota_amount", "quota_unmetered", "coffee")
list_display = (
'event',
'user_profile',
'quota_used',
'quota_multiplier',
'quota_amount',
'quota_unmetered',
'coffee'
)


class EventAdmin(admin.ModelAdmin):
list_display = ("name", "start", "end", "is_active")
list_display = ('name', 'start', 'end', 'is_active')


class NetworkHostAdmin(admin.ModelAdmin):
list_display = ("mac_address", "ip_address", "computer_name", "user_profile", "online", "vendor")
list_display = (
'mac_address',
'ip_address',
'computer_name',
'user_profile',
'online',
'vendor'
)


class UserProfileAdmin(admin.ModelAdmin):
list_display = ("user", "internet_on")
list_display = ('user', 'internet_on')


class QuotaResetEventAdmin(admin.ModelAdmin):
list_display = ("when", "event_attendance", "performer", "excuse")
list_display = ('when', 'event_attendance', 'performer', 'excuse')


class NetworkHostOwnerChangeEventAdmin(admin.ModelAdmin):
list_display = ("when", "old_owner", "new_owner", "network_host")
list_display = ('when', 'old_owner', 'new_owner', 'network_host')


class NetworkUsageDataPointAdmin(admin.ModelAdmin):
list_display = ("when", "event_attendance", "bytes")
list_display = ('when', 'event_attendance', 'bytes')


class OuiAdmin(admin.ModelAdmin):
list_display = ("hex", "full_name", "slug", "is_console")
list_display = ('hex', 'full_name', 'slug', 'is_console')
list_filter = ('is_console', 'slug')


class IP4ProtocolAdmin(admin.ModelAdmin):
list_display = ('name', 'description', 'has_port')


class IP4PortForwardAdmin(admin.ModelAdmin):
list_display = ('host', 'protocol', 'port', 'creator', 'created', 'enabled')
list_display = (
'host',
'protocol',
'port',
'creator',
'created',
'enabled'
)
list_filter = ('enabled', 'host')

mapairs = (
Expand Down
4 changes: 3 additions & 1 deletion tollgate/frontend/views.py
@@ -1,4 +1,6 @@
"""tollgate frontend views
#!/usr/bin/env python
"""
tollgate frontend views
Copyright 2008-2012 Michael Farrell
This program is free software: you can redistribute it and/or modify
Expand Down

0 comments on commit 5e78f3c

Please sign in to comment.