add AddressPool to core admins
diff --git a/xos/core/admin.py b/xos/core/admin.py
index 7a88d0e..7f9e8fe 100644
--- a/xos/core/admin.py
+++ b/xos/core/admin.py
@@ -2109,6 +2109,39 @@
return tabs
+class AddressPoolForm(forms.ModelForm):
+ class Meta:
+ model = Program
+ widgets = {
+ 'addresses': UploadTextareaWidget(attrs={'rows': 20, 'cols': 80, 'class': "input-xxlarge"}),
+ }
+
+class AddressPoolAdmin(XOSBaseAdmin):
+ list_display = ("name",)
+ list_display_links = ('name',)
+
+ form=AddressPoolForm
+
+ fieldsets = [
+ (None, {'fields': ['name', 'gateway_ip', 'gateway_mac', 'addresses', 'inuse', 'service'],
+ 'classes':['suit-tab suit-tab-general']}),
+ ]
+
+ readonly_fields = ("status",)
+
+ @property
+ def suit_form_tabs(self):
+ tabs=[('general','Program Details'),
+ ('contents','Program Source'),
+ ('messages','Messages'),
+ ]
+
+# request=getattr(_thread_locals, "request", None)
+# if request and request.user.is_admin:
+# tabs.append( ('admin-only', 'Admin-Only') )
+
+ return tabs
+
# Now register the new UserAdmin...
admin.site.register(User, UserAdmin)
# ... and, since we're not using Django's builtin permissions,
@@ -2151,5 +2184,5 @@
admin.site.register(TenantRoot, TenantRootAdmin)
admin.site.register(TenantRootRole, TenantRootRoleAdmin)
admin.site.register(TenantAttribute, TenantAttributeAdmin)
-# admin.site.register(Container, ContainerAdmin)
+ admin.site.register(AddressPool, AddressPoolAdmin)