2021-10-18 15:09:57 -04:00
|
|
|
from django.contrib.contenttypes.models import ContentType
|
|
|
|
from django.shortcuts import get_object_or_404
|
2023-01-25 12:26:38 -05:00
|
|
|
from django.utils.translation import gettext as _
|
2021-10-18 15:09:57 -04:00
|
|
|
|
2020-11-11 16:07:38 -05:00
|
|
|
from netbox.views import generic
|
2023-11-16 12:02:32 -05:00
|
|
|
from utilities.utils import count_related, get_related_models
|
2023-05-12 19:56:26 +05:30
|
|
|
from utilities.views import register_model_view, ViewTab
|
2021-04-29 16:38:56 -04:00
|
|
|
from . import filtersets, forms, tables
|
2021-10-18 11:45:05 -04:00
|
|
|
from .models import *
|
2016-07-26 14:58:37 -04:00
|
|
|
|
|
|
|
|
2023-05-12 19:56:26 +05:30
|
|
|
class ObjectContactsView(generic.ObjectChildrenView):
|
2023-05-30 14:51:16 -04:00
|
|
|
child_model = ContactAssignment
|
|
|
|
table = tables.ContactAssignmentTable
|
|
|
|
filterset = filtersets.ContactAssignmentFilterSet
|
2023-05-12 19:56:26 +05:30
|
|
|
template_name = 'tenancy/object_contacts.html'
|
|
|
|
tab = ViewTab(
|
|
|
|
label=_('Contacts'),
|
|
|
|
badge=lambda obj: obj.contacts.count(),
|
2023-05-30 14:51:16 -04:00
|
|
|
permission='tenancy.view_contactassignment',
|
2023-05-12 19:56:26 +05:30
|
|
|
weight=5000
|
|
|
|
)
|
|
|
|
|
|
|
|
def get_children(self, request, parent):
|
2023-05-30 14:51:16 -04:00
|
|
|
return ContactAssignment.objects.restrict(request.user, 'view').filter(
|
|
|
|
content_type=ContentType.objects.get_for_model(parent),
|
|
|
|
object_id=parent.pk
|
2024-01-17 10:33:59 -05:00
|
|
|
).order_by('priority', 'contact', 'role')
|
2023-05-12 19:56:26 +05:30
|
|
|
|
2023-05-30 14:51:16 -04:00
|
|
|
def get_table(self, *args, **kwargs):
|
|
|
|
table = super().get_table(*args, **kwargs)
|
|
|
|
|
|
|
|
# Hide object columns
|
|
|
|
table.columns.hide('content_type')
|
|
|
|
table.columns.hide('object')
|
|
|
|
|
|
|
|
return table
|
|
|
|
|
2016-07-26 14:58:37 -04:00
|
|
|
#
|
|
|
|
# Tenant groups
|
|
|
|
#
|
|
|
|
|
2023-05-12 19:56:26 +05:30
|
|
|
|
2020-11-11 16:07:38 -05:00
|
|
|
class TenantGroupListView(generic.ObjectListView):
|
2020-03-11 20:20:04 -04:00
|
|
|
queryset = TenantGroup.objects.add_related_count(
|
|
|
|
TenantGroup.objects.all(),
|
|
|
|
Tenant,
|
|
|
|
'group',
|
|
|
|
'tenant_count',
|
|
|
|
cumulative=True
|
|
|
|
)
|
2021-07-20 15:39:58 -04:00
|
|
|
filterset = filtersets.TenantGroupFilterSet
|
|
|
|
filterset_form = forms.TenantGroupFilterForm
|
2016-07-26 14:58:37 -04:00
|
|
|
table = tables.TenantGroupTable
|
|
|
|
|
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(TenantGroup)
|
2021-03-26 15:07:29 -04:00
|
|
|
class TenantGroupView(generic.ObjectView):
|
|
|
|
queryset = TenantGroup.objects.all()
|
|
|
|
|
2023-01-25 15:21:21 -05:00
|
|
|
def get_extra_context(self, request, instance):
|
|
|
|
groups = instance.get_descendants(include_self=True)
|
|
|
|
related_models = (
|
|
|
|
(Tenant.objects.restrict(request.user, 'view').filter(group__in=groups), 'group_id'),
|
|
|
|
)
|
|
|
|
|
|
|
|
return {
|
|
|
|
'related_models': related_models,
|
|
|
|
}
|
|
|
|
|
2021-03-26 15:07:29 -04:00
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(TenantGroup, 'edit')
|
2020-11-11 16:07:38 -05:00
|
|
|
class TenantGroupEditView(generic.ObjectEditView):
|
2020-05-11 12:37:22 -04:00
|
|
|
queryset = TenantGroup.objects.all()
|
2022-03-21 10:22:30 -04:00
|
|
|
form = forms.TenantGroupForm
|
2016-07-26 14:58:37 -04:00
|
|
|
|
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(TenantGroup, 'delete')
|
2020-11-11 16:07:38 -05:00
|
|
|
class TenantGroupDeleteView(generic.ObjectDeleteView):
|
2020-07-01 12:08:26 -04:00
|
|
|
queryset = TenantGroup.objects.all()
|
|
|
|
|
|
|
|
|
2020-11-11 16:07:38 -05:00
|
|
|
class TenantGroupBulkImportView(generic.BulkImportView):
|
2020-05-21 11:58:27 -04:00
|
|
|
queryset = TenantGroup.objects.all()
|
2022-11-15 12:24:57 -05:00
|
|
|
model_form = forms.TenantGroupImportForm
|
2017-10-09 15:09:40 -04:00
|
|
|
|
|
|
|
|
2021-03-12 16:14:42 -05:00
|
|
|
class TenantGroupBulkEditView(generic.BulkEditView):
|
|
|
|
queryset = TenantGroup.objects.add_related_count(
|
|
|
|
TenantGroup.objects.all(),
|
|
|
|
Tenant,
|
|
|
|
'group',
|
|
|
|
'tenant_count',
|
|
|
|
cumulative=True
|
|
|
|
)
|
2021-04-29 16:38:56 -04:00
|
|
|
filterset = filtersets.TenantGroupFilterSet
|
2021-03-12 16:14:42 -05:00
|
|
|
table = tables.TenantGroupTable
|
|
|
|
form = forms.TenantGroupBulkEditForm
|
|
|
|
|
|
|
|
|
2020-11-11 16:07:38 -05:00
|
|
|
class TenantGroupBulkDeleteView(generic.BulkDeleteView):
|
2020-07-20 12:07:19 -04:00
|
|
|
queryset = TenantGroup.objects.add_related_count(
|
|
|
|
TenantGroup.objects.all(),
|
|
|
|
Tenant,
|
|
|
|
'group',
|
|
|
|
'tenant_count',
|
|
|
|
cumulative=True
|
|
|
|
)
|
2023-04-07 10:25:36 -04:00
|
|
|
filterset = filtersets.TenantGroupFilterSet
|
2017-07-13 17:39:28 -04:00
|
|
|
table = tables.TenantGroupTable
|
2016-07-26 14:58:37 -04:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Tenants
|
|
|
|
#
|
|
|
|
|
2020-11-11 16:07:38 -05:00
|
|
|
class TenantListView(generic.ObjectListView):
|
2020-10-30 16:52:40 -04:00
|
|
|
queryset = Tenant.objects.all()
|
2021-04-29 16:38:56 -04:00
|
|
|
filterset = filtersets.TenantFilterSet
|
2020-01-09 20:57:13 -05:00
|
|
|
filterset_form = forms.TenantFilterForm
|
2016-07-26 14:58:37 -04:00
|
|
|
table = tables.TenantTable
|
|
|
|
|
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(Tenant)
|
2020-11-11 16:07:38 -05:00
|
|
|
class TenantView(generic.ObjectView):
|
2022-07-30 01:18:30 +02:00
|
|
|
queryset = Tenant.objects.all()
|
2017-05-18 17:00:57 -04:00
|
|
|
|
2020-11-19 15:59:11 -05:00
|
|
|
def get_extra_context(self, request, instance):
|
2023-01-25 12:26:38 -05:00
|
|
|
related_models = [
|
2023-11-16 12:02:32 -05:00
|
|
|
(model.objects.restrict(request.user, 'view').filter(tenant=instance), f'{field}_id')
|
|
|
|
for model, field in get_related_models(Tenant)
|
2023-01-25 12:26:38 -05:00
|
|
|
]
|
2017-05-18 17:00:57 -04:00
|
|
|
|
2020-11-19 15:59:11 -05:00
|
|
|
return {
|
2023-01-25 12:26:38 -05:00
|
|
|
'related_models': related_models,
|
2020-11-19 15:59:11 -05:00
|
|
|
}
|
2016-07-26 14:58:37 -04:00
|
|
|
|
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(Tenant, 'edit')
|
2020-11-11 16:07:38 -05:00
|
|
|
class TenantEditView(generic.ObjectEditView):
|
2020-05-11 12:37:22 -04:00
|
|
|
queryset = Tenant.objects.all()
|
2022-03-21 10:22:30 -04:00
|
|
|
form = forms.TenantForm
|
2016-07-26 14:58:37 -04:00
|
|
|
|
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(Tenant, 'delete')
|
2020-11-11 16:07:38 -05:00
|
|
|
class TenantDeleteView(generic.ObjectDeleteView):
|
2020-05-11 12:47:01 -04:00
|
|
|
queryset = Tenant.objects.all()
|
2016-07-26 14:58:37 -04:00
|
|
|
|
|
|
|
|
2020-11-11 16:07:38 -05:00
|
|
|
class TenantBulkImportView(generic.BulkImportView):
|
2020-05-21 11:58:27 -04:00
|
|
|
queryset = Tenant.objects.all()
|
2022-11-15 12:24:57 -05:00
|
|
|
model_form = forms.TenantImportForm
|
2016-07-26 14:58:37 -04:00
|
|
|
|
|
|
|
|
2020-11-11 16:07:38 -05:00
|
|
|
class TenantBulkEditView(generic.BulkEditView):
|
2022-07-30 01:18:30 +02:00
|
|
|
queryset = Tenant.objects.all()
|
2021-04-29 16:38:56 -04:00
|
|
|
filterset = filtersets.TenantFilterSet
|
2017-07-13 16:31:47 -04:00
|
|
|
table = tables.TenantTable
|
2016-07-26 14:58:37 -04:00
|
|
|
form = forms.TenantBulkEditForm
|
|
|
|
|
|
|
|
|
2020-11-11 16:07:38 -05:00
|
|
|
class TenantBulkDeleteView(generic.BulkDeleteView):
|
2022-07-30 01:18:30 +02:00
|
|
|
queryset = Tenant.objects.all()
|
2021-04-29 16:38:56 -04:00
|
|
|
filterset = filtersets.TenantFilterSet
|
2017-07-13 17:39:28 -04:00
|
|
|
table = tables.TenantTable
|
2021-10-18 11:45:05 -04:00
|
|
|
|
|
|
|
|
2023-05-12 19:56:26 +05:30
|
|
|
@register_model_view(Tenant, 'contacts')
|
|
|
|
class TenantContactsView(ObjectContactsView):
|
|
|
|
queryset = Tenant.objects.all()
|
|
|
|
|
|
|
|
|
2021-10-18 11:45:05 -04:00
|
|
|
#
|
|
|
|
# Contact groups
|
|
|
|
#
|
|
|
|
|
|
|
|
class ContactGroupListView(generic.ObjectListView):
|
|
|
|
queryset = ContactGroup.objects.add_related_count(
|
|
|
|
ContactGroup.objects.all(),
|
|
|
|
Contact,
|
|
|
|
'group',
|
|
|
|
'contact_count',
|
|
|
|
cumulative=True
|
|
|
|
)
|
|
|
|
filterset = filtersets.ContactGroupFilterSet
|
|
|
|
filterset_form = forms.ContactGroupFilterForm
|
|
|
|
table = tables.ContactGroupTable
|
|
|
|
|
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(ContactGroup)
|
2021-10-18 11:45:05 -04:00
|
|
|
class ContactGroupView(generic.ObjectView):
|
|
|
|
queryset = ContactGroup.objects.all()
|
|
|
|
|
2023-01-25 15:21:21 -05:00
|
|
|
def get_extra_context(self, request, instance):
|
|
|
|
groups = instance.get_descendants(include_self=True)
|
|
|
|
related_models = (
|
|
|
|
(Contact.objects.restrict(request.user, 'view').filter(group__in=groups), 'group_id'),
|
|
|
|
)
|
|
|
|
|
|
|
|
return {
|
|
|
|
'related_models': related_models,
|
|
|
|
}
|
|
|
|
|
2021-10-18 11:45:05 -04:00
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(ContactGroup, 'edit')
|
2021-10-18 11:45:05 -04:00
|
|
|
class ContactGroupEditView(generic.ObjectEditView):
|
|
|
|
queryset = ContactGroup.objects.all()
|
2022-03-21 10:22:30 -04:00
|
|
|
form = forms.ContactGroupForm
|
2021-10-18 11:45:05 -04:00
|
|
|
|
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(ContactGroup, 'delete')
|
2021-10-18 11:45:05 -04:00
|
|
|
class ContactGroupDeleteView(generic.ObjectDeleteView):
|
|
|
|
queryset = ContactGroup.objects.all()
|
|
|
|
|
|
|
|
|
|
|
|
class ContactGroupBulkImportView(generic.BulkImportView):
|
|
|
|
queryset = ContactGroup.objects.all()
|
2022-11-15 12:24:57 -05:00
|
|
|
model_form = forms.ContactGroupImportForm
|
2021-10-18 11:45:05 -04:00
|
|
|
|
|
|
|
|
|
|
|
class ContactGroupBulkEditView(generic.BulkEditView):
|
|
|
|
queryset = ContactGroup.objects.add_related_count(
|
|
|
|
ContactGroup.objects.all(),
|
|
|
|
Contact,
|
|
|
|
'group',
|
|
|
|
'contact_count',
|
|
|
|
cumulative=True
|
|
|
|
)
|
|
|
|
filterset = filtersets.ContactGroupFilterSet
|
|
|
|
table = tables.ContactGroupTable
|
|
|
|
form = forms.ContactGroupBulkEditForm
|
|
|
|
|
|
|
|
|
|
|
|
class ContactGroupBulkDeleteView(generic.BulkDeleteView):
|
|
|
|
queryset = ContactGroup.objects.add_related_count(
|
|
|
|
ContactGroup.objects.all(),
|
|
|
|
Contact,
|
|
|
|
'group',
|
|
|
|
'contact_count',
|
|
|
|
cumulative=True
|
|
|
|
)
|
2023-04-07 10:25:36 -04:00
|
|
|
filterset = filtersets.ContactGroupFilterSet
|
2021-10-18 11:45:05 -04:00
|
|
|
table = tables.ContactGroupTable
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Contact roles
|
|
|
|
#
|
|
|
|
|
|
|
|
class ContactRoleListView(generic.ObjectListView):
|
|
|
|
queryset = ContactRole.objects.all()
|
|
|
|
filterset = filtersets.ContactRoleFilterSet
|
|
|
|
filterset_form = forms.ContactRoleFilterForm
|
|
|
|
table = tables.ContactRoleTable
|
|
|
|
|
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(ContactRole)
|
2021-10-18 11:45:05 -04:00
|
|
|
class ContactRoleView(generic.ObjectView):
|
|
|
|
queryset = ContactRole.objects.all()
|
|
|
|
|
|
|
|
def get_extra_context(self, request, instance):
|
2023-01-26 09:54:24 -05:00
|
|
|
related_models = (
|
|
|
|
(ContactAssignment.objects.restrict(request.user, 'view').filter(role=instance), 'role_id'),
|
2021-10-18 11:45:05 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
return {
|
2023-01-26 09:54:24 -05:00
|
|
|
'related_models': related_models,
|
2021-10-18 11:45:05 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(ContactRole, 'edit')
|
2021-10-18 11:45:05 -04:00
|
|
|
class ContactRoleEditView(generic.ObjectEditView):
|
|
|
|
queryset = ContactRole.objects.all()
|
2022-03-21 10:22:30 -04:00
|
|
|
form = forms.ContactRoleForm
|
2021-10-18 11:45:05 -04:00
|
|
|
|
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(ContactRole, 'delete')
|
2021-10-18 11:45:05 -04:00
|
|
|
class ContactRoleDeleteView(generic.ObjectDeleteView):
|
|
|
|
queryset = ContactRole.objects.all()
|
|
|
|
|
|
|
|
|
|
|
|
class ContactRoleBulkImportView(generic.BulkImportView):
|
|
|
|
queryset = ContactRole.objects.all()
|
2022-11-15 12:24:57 -05:00
|
|
|
model_form = forms.ContactRoleImportForm
|
2021-10-18 11:45:05 -04:00
|
|
|
|
|
|
|
|
|
|
|
class ContactRoleBulkEditView(generic.BulkEditView):
|
|
|
|
queryset = ContactRole.objects.all()
|
|
|
|
filterset = filtersets.ContactRoleFilterSet
|
|
|
|
table = tables.ContactRoleTable
|
|
|
|
form = forms.ContactRoleBulkEditForm
|
|
|
|
|
|
|
|
|
|
|
|
class ContactRoleBulkDeleteView(generic.BulkDeleteView):
|
|
|
|
queryset = ContactRole.objects.all()
|
2023-04-07 10:25:36 -04:00
|
|
|
filterset = filtersets.ContactRoleFilterSet
|
2021-10-18 11:45:05 -04:00
|
|
|
table = tables.ContactRoleTable
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Contacts
|
|
|
|
#
|
|
|
|
|
|
|
|
class ContactListView(generic.ObjectListView):
|
2021-10-18 15:30:28 -04:00
|
|
|
queryset = Contact.objects.annotate(
|
|
|
|
assignment_count=count_related(ContactAssignment, 'contact')
|
|
|
|
)
|
2021-10-18 11:45:05 -04:00
|
|
|
filterset = filtersets.ContactFilterSet
|
|
|
|
filterset_form = forms.ContactFilterForm
|
|
|
|
table = tables.ContactTable
|
|
|
|
|
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(Contact)
|
2021-10-18 11:45:05 -04:00
|
|
|
class ContactView(generic.ObjectView):
|
|
|
|
queryset = Contact.objects.all()
|
|
|
|
|
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(Contact, 'edit')
|
2021-10-18 11:45:05 -04:00
|
|
|
class ContactEditView(generic.ObjectEditView):
|
|
|
|
queryset = Contact.objects.all()
|
2022-03-21 10:22:30 -04:00
|
|
|
form = forms.ContactForm
|
2021-10-18 11:45:05 -04:00
|
|
|
|
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(Contact, 'delete')
|
2021-10-18 11:45:05 -04:00
|
|
|
class ContactDeleteView(generic.ObjectDeleteView):
|
|
|
|
queryset = Contact.objects.all()
|
|
|
|
|
|
|
|
|
|
|
|
class ContactBulkImportView(generic.BulkImportView):
|
|
|
|
queryset = Contact.objects.all()
|
2022-11-15 12:24:57 -05:00
|
|
|
model_form = forms.ContactImportForm
|
2021-10-18 11:45:05 -04:00
|
|
|
|
|
|
|
|
|
|
|
class ContactBulkEditView(generic.BulkEditView):
|
2022-11-01 15:27:35 -04:00
|
|
|
queryset = Contact.objects.annotate(
|
|
|
|
assignment_count=count_related(ContactAssignment, 'contact')
|
|
|
|
)
|
2021-10-18 11:45:05 -04:00
|
|
|
filterset = filtersets.ContactFilterSet
|
|
|
|
table = tables.ContactTable
|
|
|
|
form = forms.ContactBulkEditForm
|
|
|
|
|
|
|
|
|
|
|
|
class ContactBulkDeleteView(generic.BulkDeleteView):
|
2022-11-01 15:27:35 -04:00
|
|
|
queryset = Contact.objects.annotate(
|
|
|
|
assignment_count=count_related(ContactAssignment, 'contact')
|
|
|
|
)
|
2021-10-18 11:45:05 -04:00
|
|
|
filterset = filtersets.ContactFilterSet
|
|
|
|
table = tables.ContactTable
|
2021-10-18 15:09:57 -04:00
|
|
|
|
|
|
|
#
|
|
|
|
# Contact assignments
|
|
|
|
#
|
|
|
|
|
2023-05-12 19:56:26 +05:30
|
|
|
|
2023-01-26 09:46:28 -05:00
|
|
|
class ContactAssignmentListView(generic.ObjectListView):
|
|
|
|
queryset = ContactAssignment.objects.all()
|
|
|
|
filterset = filtersets.ContactAssignmentFilterSet
|
|
|
|
filterset_form = forms.ContactAssignmentFilterForm
|
|
|
|
table = tables.ContactAssignmentTable
|
2023-10-20 15:08:09 -04:00
|
|
|
actions = {
|
2023-11-09 16:06:26 -05:00
|
|
|
'import': {'add'},
|
2023-10-20 15:08:09 -04:00
|
|
|
'export': {'view'},
|
|
|
|
'bulk_edit': {'change'},
|
|
|
|
'bulk_delete': {'delete'},
|
|
|
|
}
|
2023-01-26 09:46:28 -05:00
|
|
|
|
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(ContactAssignment, 'edit')
|
2021-10-18 15:09:57 -04:00
|
|
|
class ContactAssignmentEditView(generic.ObjectEditView):
|
|
|
|
queryset = ContactAssignment.objects.all()
|
2022-03-21 10:22:30 -04:00
|
|
|
form = forms.ContactAssignmentForm
|
2021-11-04 13:44:02 -04:00
|
|
|
template_name = 'tenancy/contactassignment_edit.html'
|
2021-10-18 15:09:57 -04:00
|
|
|
|
2021-12-14 11:28:13 -05:00
|
|
|
def alter_object(self, instance, request, args, kwargs):
|
2021-10-18 15:09:57 -04:00
|
|
|
if not instance.pk:
|
|
|
|
# Assign the object based on URL kwargs
|
2021-11-09 17:08:28 -05:00
|
|
|
content_type = get_object_or_404(ContentType, pk=request.GET.get('content_type'))
|
2021-10-18 15:09:57 -04:00
|
|
|
instance.object = get_object_or_404(content_type.model_class(), pk=request.GET.get('object_id'))
|
|
|
|
return instance
|
|
|
|
|
2022-08-23 09:29:55 -07:00
|
|
|
def get_extra_addanother_params(self, request):
|
|
|
|
return {
|
|
|
|
'content_type': request.GET.get('content_type'),
|
|
|
|
'object_id': request.GET.get('object_id'),
|
|
|
|
}
|
2022-08-22 16:31:41 -07:00
|
|
|
|
2021-10-18 15:09:57 -04:00
|
|
|
|
2023-03-21 13:47:08 -04:00
|
|
|
class ContactAssignmentBulkEditView(generic.BulkEditView):
|
|
|
|
queryset = ContactAssignment.objects.all()
|
|
|
|
filterset = filtersets.ContactAssignmentFilterSet
|
|
|
|
table = tables.ContactAssignmentTable
|
|
|
|
form = forms.ContactAssignmentBulkEditForm
|
|
|
|
|
|
|
|
|
2023-07-28 18:53:22 +05:30
|
|
|
class ContactAssignmentBulkImportView(generic.BulkImportView):
|
|
|
|
queryset = ContactAssignment.objects.all()
|
|
|
|
model_form = forms.ContactAssignmentImportForm
|
|
|
|
|
|
|
|
|
2023-02-15 12:55:25 +01:00
|
|
|
class ContactAssignmentBulkDeleteView(generic.BulkDeleteView):
|
|
|
|
queryset = ContactAssignment.objects.all()
|
|
|
|
filterset = filtersets.ContactAssignmentFilterSet
|
|
|
|
table = tables.ContactAssignmentTable
|
|
|
|
|
|
|
|
|
2022-10-07 17:17:58 -04:00
|
|
|
@register_model_view(ContactAssignment, 'delete')
|
2021-10-18 15:09:57 -04:00
|
|
|
class ContactAssignmentDeleteView(generic.ObjectDeleteView):
|
|
|
|
queryset = ContactAssignment.objects.all()
|