class SecurityGroupsTable(tables.DataTable): name = tables.Column("name") description = tables.Column("description") class Meta: name = "security_groups" verbose_name = _("Security Groups") table_actions = (CreateGroup, DeleteGroup) row_actions = (EditRules, DeleteGroup)
class RulesTable(tables.DataTable): protocol = tables.Column("ip_protocol", verbose_name=_("IP Protocol")) from_port = tables.Column("from_port", verbose_name=_("From Port")) to_port = tables.Column("to_port", verbose_name=_("To Port")) cidr = tables.Column(get_cidr, verbose_name=_("CIDR")) class Meta: name = "rules" verbose_name = _("Security Group Rules") row_actions = (DeleteRule,)
class FloatingIPsTable(tables.DataTable): ip = tables.Column("ip", verbose_name=_("IP Address")) instance = tables.Column("instance_id", verbose_name=_("Instance"), empty_value="-") class Meta: name = "floating_ips" verbose_name = _("Floating IPs") table_actions = (AllocateIP, ReleaseIP) row_actions = (AssociateIP, DisassociateIP, ReleaseIP)
class QuotasTable(tables.DataTable): name = tables.Column('name', verbose_name=_('Quota Name')) limit = tables.Column("limit", verbose_name=_('Limit')) def get_object_id(self, obj): return obj.name class Meta: name = "quotas" verbose_name = _("Quotas") table_actions = (QuotaFilterAction, ) multi_select = False
class TenantsTable(tables.DataTable): id = tables.Column('id', verbose_name=_('Id')) name = tables.Column('name', verbose_name=_('Name')) description = tables.Column("description", verbose_name=_('Description')) enabled = tables.Column('enabled', verbose_name=_('Enabled'), status=True) class Meta: name = "tenants" verbose_name = _("Tenants") row_actions = (EditLink, ViewMembersLink, ModifyQuotasLink, DeleteTenantsAction) table_actions = (TenantFilterAction, CreateLink, DeleteTenantsAction)
class KeypairsTable(tables.DataTable): name = tables.Column("name") fingerprint = tables.Column("fingerprint") def get_object_id(self, keypair): return keypair.name class Meta: name = "keypairs" verbose_name = _("Keypairs") table_actions = (CreateKeyPair, ImportKeyPair, DeleteKeyPairs,) row_actions = (DeleteKeyPairs,)
class ServicesTable(tables.DataTable): id = tables.Column('id', verbose_name=_('Id'), hidden=True) service = tables.Column('type', verbose_name=_('Service')) host = tables.Column('host', verbose_name=_('Host')) stats = tables.Column(get_stats, verbose_name=_('System Stats')) enabled = tables.Column(get_enabled, verbose_name=_('Enabled'), status=True) class Meta: name = "services" verbose_name = _("Services") table_actions = (ServiceFilterAction, ) row_actions = (ToggleServiceAction, ) multi_select = False status_column = "enabled"
class UsersTable(tables.DataTable): STATUS_CHOICES = ( ("true", True), ("false", False) ) id = tables.Column(_('id')) name = tables.Column(_('name')) email = tables.Column(_('email')) # Default tenant is not returned from Keystone currently. #default_tenant = tables.Column(_('default_tenant'), # verbose_name="Default Tenant") enabled = tables.Column(_('enabled'), status=True, status_choices=STATUS_CHOICES) class Meta: name = "users" verbose_name = _("Users") row_actions = (EditUserLink, EnableUsersAction, DisableUsersAction, DeleteUsersAction) table_actions = (UserFilterAction, CreateUserLink, DeleteUsersAction)
class TempTable(MyTable): extra = tables.Column('extra') class Meta: name = "temp_table" table_actions = ( MyFilterAction, MyAction, ) row_actions = ( MyAction, MyLinkAction, )
class MyTable(tables.DataTable): id = tables.Column('id', hidden=True) name = tables.Column(get_name, verbose_name="Verbose Name", sortable=True) value = tables.Column('value', sortable=True, link='http://example.com/', attrs={'classes': ('green', 'blue')}) status = tables.Column('status', link=get_link) optional = tables.Column('optional', empty_value='N/A') excluded = tables.Column('excluded') class Meta: name = "my_table" verbose_name = "My Table" status_column = "status" columns = ('id', 'name', 'value', 'optional', 'status') table_actions = ( MyFilterAction, MyAction, ) row_actions = ( MyAction, MyLinkAction, )