Devesh's changes to request router models and observer
diff --git a/planetstack/requestrouter/admin.py b/planetstack/requestrouter/admin.py
index 0036c4a..a8fd254 100644
--- a/planetstack/requestrouter/admin.py
+++ b/planetstack/requestrouter/admin.py
@@ -10,7 +10,7 @@
from django.utils import timezone
from django.contrib.contenttypes import generic
from suit.widgets import LinkedSelect
-from core.admin import SingletonAdmin,SliceInline,ServiceAttrAsTabInline
+from core.admin import SingletonAdmin,SliceInline,ServiceAttrAsTabInline, SliceROInline,ServiceAttrAsTabROInline, ReadOnlyAwareAdmin
class RequestRouterServiceAdmin(SingletonAdmin):
model = RequestRouterService
@@ -20,18 +20,21 @@
fieldsets = [(None, {'fields': ['name','enabled','versionNumber', 'description','behindNat','defaultTTL','defaultAction','lastResortAction','maxAnswers'], 'classes':['suit-tab suit-tab-general']})]
inlines = [SliceInline,ServiceAttrAsTabInline]
+ user_readonly_inlines = [SliceROInline, ServiceAttrAsTabROInline]
suit_form_tabs =(('general', 'Request Router Service Details'),
('slices','Slices'),
('serviceattrs','Additional Attributes'),
)
-class ServiceMapAdmin(SingletonAdmin):
+class ServiceMapAdmin(ReadOnlyAwareAdmin):
model = ServiceMap
verbose_name = "Service Map"
verbose_name_plural = "Service Map"
list_display = ("name", "owner", "slice", "prefix")
- #readonly_fields = ["name"]
+ fieldsets = [(None, {'fields': ['name','owner','slice', 'prefix','siteMap','accessMap'], 'classes':['suit-tab suit-tab-general']})]
+ suit_form_tabs =(('general', 'Service Map Details'),
+ )
admin.site.register(RequestRouterService, RequestRouterServiceAdmin)
admin.site.register(ServiceMap, ServiceMapAdmin)