blob: b78f6349cb650657ac6e2dd19c62ee85053b8577 [file] [log] [blame]
Scott Bakerd219e1e2014-05-20 12:04:25 -07001from django.contrib import admin
2
3from cassandra.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
Scott Bakerff934492014-08-15 16:39:05 -070013from core.admin import SingletonAdmin,SliceInline,ServiceAttrAsTabInline,ReadOnlyAwareAdmin
Scott Bakerd219e1e2014-05-20 12:04:25 -070014
15class CassandraServiceAdmin(SingletonAdmin):
16 model = CassandraService
17 verbose_name = "Cassandra Service"
18 verbose_name_plural = "Cassandra Service"
19 list_display = ("name","enabled")
20 fieldsets = [(None, {'fields': ['name','enabled','versionNumber', 'description','clusterSize','replicationFactor'], 'classes':['suit-tab suit-tab-general']})]
21 inlines = [SliceInline,ServiceAttrAsTabInline]
22
Scott Bakerf66ffc52014-05-23 13:20:17 -070023 user_readonly_fields = ["name", "enabled", "versionNumber", "description", "clusterSize", "replicationFactor"]
24
Scott Bakerd219e1e2014-05-20 12:04:25 -070025 suit_form_tabs =(('general', 'Cassandra Service Details'),
26 ('slices','Slices'),
27 ('serviceattrs','Additional Attributes'),
28 )
29
30admin.site.register(CassandraService, CassandraServiceAdmin)
31