Create the views one for the installation properties namespaces and another for the details of each namespace
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from south.signals import post_migrate
|
||||
|
||||
from project_tools.api import register_tool
|
||||
|
||||
from django.db import transaction
|
||||
from django.db.models.signals import post_save
|
||||
from django.db.utils import DatabaseError
|
||||
from django.dispatch import receiver
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from .links import installation_details
|
||||
from south.signals import post_migrate
|
||||
|
||||
from common.utils import encapsulate
|
||||
from navigation.api import register_links, register_model_list_columns
|
||||
from project_tools.api import register_tool
|
||||
|
||||
from .classes import Property, PropertyNamespace
|
||||
from .links import link_menu_link, link_namespace_details, link_namespace_list
|
||||
from .models import Installation
|
||||
|
||||
|
||||
@@ -33,6 +37,31 @@ def check_first_run():
|
||||
details.submit()
|
||||
|
||||
|
||||
register_tool(installation_details)
|
||||
register_model_list_columns(PropertyNamespace, [
|
||||
{
|
||||
'name': _(u'label'),
|
||||
'attribute': 'label'
|
||||
},
|
||||
{
|
||||
'name': _(u'items'),
|
||||
'attribute': encapsulate(lambda entry: len(entry.get_properties()))
|
||||
}
|
||||
])
|
||||
|
||||
register_model_list_columns(Property, [
|
||||
{
|
||||
'name': _(u'label'),
|
||||
'attribute': 'label'
|
||||
},
|
||||
{
|
||||
'name': _(u'value'),
|
||||
'attribute': 'value'
|
||||
}
|
||||
])
|
||||
|
||||
register_links(PropertyNamespace, [link_namespace_details])
|
||||
register_links(['namespace_list', PropertyNamespace], [link_namespace_list], menu_name='secondary_menu')
|
||||
|
||||
register_tool(link_menu_link)
|
||||
|
||||
check_first_run()
|
||||
|
||||
Reference in New Issue
Block a user