~lifeless/python-oops-tools/bug-881400

« back to all changes in this revision

Viewing changes to src/oopstools/oops/admin.py

  • Committer: Robert Collins
  • Date: 2011-10-13 20:18:51 UTC
  • Revision ID: robertc@robertcollins.net-20111013201851-ym8jmdhoeol3p83s
Export of cruft-deleted tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2009-2011 Canonical Ltd.  All rights reserved.
 
2
#
 
3
# This program is free software: you can redistribute it and/or modify
 
4
# it under the terms of the GNU Affero General Public License as published by
 
5
# the Free Software Foundation, either version 3 of the License, or
 
6
# (at your option) any later version.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU Affero General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU Affero General Public License
 
14
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 
 
16
from django.contrib import admin
 
17
 
 
18
from oopstools.oops.models import Infestation, Oops, Prefix, Report
 
19
 
 
20
 
 
21
class OopsAdmin(admin.ModelAdmin):
 
22
    list_display = ('oopsid', 'oopsinfestation')
 
23
 
 
24
 
 
25
class InfestationAdmin(admin.ModelAdmin):
 
26
    list_display = (
 
27
        'bug', 'exception_type', 'exception_value')
 
28
 
 
29
 
 
30
class ReportAdmin(admin.ModelAdmin):
 
31
    list_display = (
 
32
        'name', 'title', 'summary', 'active')
 
33
    filter_horizontal = ('prefixes',)
 
34
 
 
35
 
 
36
class PrefixAdmin(admin.ModelAdmin):
 
37
    list_display = ('value', 'appinstance')
 
38
 
 
39
 
 
40
admin.site.register(Oops)
 
41
admin.site.register(Infestation, InfestationAdmin)
 
42
admin.site.register(Report, ReportAdmin)
 
43
admin.site.register(Prefix, PrefixAdmin)