add a link to users to the customer_table_view
This commit is contained in:
parent
fd4b0564d4
commit
cfb452e55e
|
@ -10,6 +10,7 @@ class CustomersTable(tables.Table):
|
||||||
devices = tables.LinkColumn('devices', text='Devices', args=[A('pk')])
|
devices = tables.LinkColumn('devices', text='Devices', args=[A('pk')])
|
||||||
backups = tables.LinkColumn('backups', text='Backups', args=[A('pk')])
|
backups = tables.LinkColumn('backups', text='Backups', args=[A('pk')])
|
||||||
licenses = tables.LinkColumn('licenses', text='Licenses', args=[A('pk')])
|
licenses = tables.LinkColumn('licenses', text='Licenses', args=[A('pk')])
|
||||||
|
users = tables.LinkColumn('users', text='Users', args=[A('pk')])
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
template_name = 'django_tables2/semantic.html'
|
template_name = 'django_tables2/semantic.html'
|
||||||
|
|
|
@ -54,7 +54,11 @@ def test_customer_list_view(create_admin_user):
|
||||||
and helper.in_content(response,
|
and helper.in_content(response,
|
||||||
"/customer/"
|
"/customer/"
|
||||||
+ str(customer.id)
|
+ str(customer.id)
|
||||||
+ "/licenses/"))
|
+ "/licenses/")
|
||||||
|
and helper.in_content(response,
|
||||||
|
"/customer/"
|
||||||
|
+ str(customer.id)
|
||||||
|
+ "/users/"))
|
||||||
|
|
||||||
|
|
||||||
def test_customer_list_view_multiple_customers(create_admin_user):
|
def test_customer_list_view_multiple_customers(create_admin_user):
|
||||||
|
@ -87,6 +91,10 @@ def test_customer_list_view_multiple_customers(create_admin_user):
|
||||||
"/customer/"
|
"/customer/"
|
||||||
+ str(customer1.id)
|
+ str(customer1.id)
|
||||||
+ "/licenses/")
|
+ "/licenses/")
|
||||||
|
and helper.in_content(response,
|
||||||
|
"/customer/"
|
||||||
|
+ str(customer1.id)
|
||||||
|
+ "/users/")
|
||||||
and helper.in_content(response, customer2)
|
and helper.in_content(response, customer2)
|
||||||
and helper.in_content(response,
|
and helper.in_content(response,
|
||||||
"/customer/"
|
"/customer/"
|
||||||
|
@ -107,5 +115,9 @@ def test_customer_list_view_multiple_customers(create_admin_user):
|
||||||
and helper.in_content(response,
|
and helper.in_content(response,
|
||||||
"/customer/"
|
"/customer/"
|
||||||
+ str(customer2.id)
|
+ str(customer2.id)
|
||||||
+ "/licenses/"))
|
+ "/licenses/")
|
||||||
|
and helper.in_content(response,
|
||||||
|
"/customer/"
|
||||||
|
+ str(customer1.id)
|
||||||
|
+ "/users/"))
|
||||||
|
|
||||||
|
|
|
@ -24,4 +24,6 @@ urlpatterns = [
|
||||||
name='all_computers'),
|
name='all_computers'),
|
||||||
path('customer/<int:pk>/licenses/', views.licenses_table_view,
|
path('customer/<int:pk>/licenses/', views.licenses_table_view,
|
||||||
name='licenses'),
|
name='licenses'),
|
||||||
|
path('customer/<int:pk>/users/', views.users_table_view,
|
||||||
|
name='users'),
|
||||||
]
|
]
|
||||||
|
|
|
@ -146,3 +146,9 @@ def licenses_table_view(request, pk):
|
||||||
RequestConfig(request).configure(computer_licenses)
|
RequestConfig(request).configure(computer_licenses)
|
||||||
return render(request, 'inventory/license_list.html', {'user_licenses': user_licenses,
|
return render(request, 'inventory/license_list.html', {'user_licenses': user_licenses,
|
||||||
'computer_licenses': computer_licenses})
|
'computer_licenses': computer_licenses})
|
||||||
|
|
||||||
|
|
||||||
|
@login_required
|
||||||
|
@customer_view_permission
|
||||||
|
def users_table_view(request, pk):
|
||||||
|
pass
|
||||||
|
|
Loading…
Reference in New Issue