Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

[admin] Added search fields and list displays #37

Merged
merged 2 commits into from
Jul 20, 2018
Merged

[admin] Added search fields and list displays #37

merged 2 commits into from
Jul 20, 2018

Conversation

anurag-ks
Copy link
Contributor

Implements and closes #17

@@ -22,6 +22,8 @@ class AbstractSubnetAdmin(TimeReadonlyAdminMixin, ModelAdmin):
change_form_template = "admin/django-ipam/subnet/change_form.html"
change_list_template = "admin/django-ipam/subnet/change_list.html"
app_name = "django_ipam"
list_display = ('subnet', 'name', 'master_subnet', 'description')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should show the name first, because different subnets are assigned to different areas of the networks which are used for different purposes and humans recognize names more easily than ip address ranges.

@@ -22,6 +22,8 @@ class AbstractSubnetAdmin(TimeReadonlyAdminMixin, ModelAdmin):
change_form_template = "admin/django-ipam/subnet/change_form.html"
change_list_template = "admin/django-ipam/subnet/change_list.html"
app_name = "django_ipam"
list_display = ('subnet', 'name', 'master_subnet', 'description')
search_fields = ['subnet', 'name']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question: does name have db_index=True in the model? If not please add it, it will speed up the search;
it makes sense to search by name so adding a database index is a very reasonable choice.
Do this change in a new commit on this same PR please.

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

migration names should be human readable as much as possible, I'll create a new issue for that

@nemesifier nemesifier merged commit 1877f1d into master Jul 20, 2018
[GSOC-18] openwisp-ipam automation moved this from To do to Done Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

[general/admin] Possibility to search for an IP or subnet
2 participants