1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #3314: Paginate object changelog entries

This commit is contained in:
Jeremy Stretch
2019-07-18 21:40:36 -04:00
parent 86b6b9bf8b
commit cab3c50ae6
3 changed files with 12 additions and 3 deletions

View File

@@ -228,6 +228,13 @@ class ObjectChangeLogView(View):
orderable=False
)
# Apply the request context
paginate = {
'paginator_class': EnhancedPaginator,
'per_page': request.GET.get('per_page', settings.PAGINATE_COUNT)
}
RequestConfig(request, paginate).configure(objectchanges_table)
# Check whether a header template exists for this model
base_template = '{}/{}.html'.format(model._meta.app_label, model._meta.model_name)
try:
@@ -239,7 +246,7 @@ class ObjectChangeLogView(View):
return render(request, 'extras/object_changelog.html', {
object_var: obj,
'objectchanges_table': objectchanges_table,
'table': objectchanges_table,
'base_template': base_template,
'active_tab': 'changelog',
})