blob: 0036c4a8b9ffc97ca36a143b987a1b1bf5cfde4c [file] [log] [blame]
Siobhan Tullyce652d02013-10-08 21:52:35 -04001from django.contrib import admin
2
3from requestrouter.models import *
4from django import forms
5from django.utils.safestring import mark_safe
6from django.contrib.auth.admin import UserAdmin
7from django.contrib.admin.widgets import FilteredSelectMultiple
8from django.contrib.auth.forms import ReadOnlyPasswordHashField
9from django.contrib.auth.signals import user_logged_in
10from django.utils import timezone
11from django.contrib.contenttypes import generic
12from suit.widgets import LinkedSelect
13from core.admin import SingletonAdmin,SliceInline,ServiceAttrAsTabInline
14
15class RequestRouterServiceAdmin(SingletonAdmin):
16 model = RequestRouterService
17 verbose_name = "Request Router Service"
18 verbose_name_plural = "Request Router Service"
19 list_display = ("name","enabled")
20 fieldsets = [(None, {'fields': ['name','enabled','versionNumber', 'description','behindNat','defaultTTL','defaultAction','lastResortAction','maxAnswers'], 'classes':['suit-tab suit-tab-general']})]
21 inlines = [SliceInline,ServiceAttrAsTabInline]
22
23 suit_form_tabs =(('general', 'Request Router Service Details'),
24 ('slices','Slices'),
25 ('serviceattrs','Additional Attributes'),
26 )
27
Scott Baker40695e12014-03-13 22:50:45 -070028class ServiceMapAdmin(SingletonAdmin):
29 model = ServiceMap
30 verbose_name = "Service Map"
31 verbose_name_plural = "Service Map"
32 list_display = ("name", "owner", "slice", "prefix")
33 #readonly_fields = ["name"]
34
Siobhan Tullyce652d02013-10-08 21:52:35 -040035
36admin.site.register(RequestRouterService, RequestRouterServiceAdmin)
Scott Baker40695e12014-03-13 22:50:45 -070037admin.site.register(ServiceMap, ServiceMapAdmin)
Siobhan Tullyce652d02013-10-08 21:52:35 -040038