Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Missing Model Fields to Virtualization Filter Sets #1938

Merged

Conversation

timizuoebideri1
Copy link
Contributor

@timizuoebideri1 timizuoebideri1 commented Jun 22, 2022

Closes: #1735

What's Changed

Fields added:

Virtualization

ClusterFilterSet

Missing fields

  • comments
  • devices (reverse related)
    • And has_devices
  • virtual_machines (reverse related)
    • And has_virtual_machines

Incorrect fields

  • tag -> tags

ClusterTypeFilterSet

Missing fields

  • clusters (reverse related)
    • And has_clusters

ClusterGroupFilterSet

Missing fields

  • clusters (reverse related)
    • And has_clusters

VirtualMachineFilterSet

Missing fields

  • comments
  • primary_ip4
  • primary_ip6
  • services (reverse related)
    • And has_services
  • interfaces (reverse related)
    • And has_interfaces

VMInterfaceFilterSet

Missing fields

  • description
  • untagged_vlan
  • tagged_vlans
  • ip_addresses
  • mode

Incorrect fields

  • tag -> tags

  • Create filter_address_in() method in IPAddressQuerySet to filter IPAddress by a list of address

  • Added relevant test case

TODO

  • Explanation of Change(s)
  • Attached Screenshots, Payload Example
  • Unit, Integration Tests
  • Documentation Updates (when adding/changing features)
  • Example Plugin Updates (when adding/changing features)
  • Outline Remaining Work, Constraints from Design

@timizuoebideri1 timizuoebideri1 changed the base branch from develop to next June 22, 2022 13:05
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
nautobot/ipam/querysets.py Outdated Show resolved Hide resolved
@glennmatthews
Copy link
Contributor

The changes here don't seem to align with the gaps identified in https://gist.github.com/jathanism/7c585954da4cb1a54997be31991cdaac#virtualization?

@bryanculver bryanculver added the type: housekeeping Changes to the application which do not directly impact the end user label Jun 23, 2022
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
@bryanculver bryanculver requested review from bryanculver and gsnider2195 and removed request for briddo June 30, 2022 17:28
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
timizuoebideri1 and others added 2 commits July 1, 2022 04:17
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
nautobot/utilities/forms/fields.py Outdated Show resolved Hide resolved
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
nautobot/virtualization/filters.py Show resolved Hide resolved
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
timizuoebideri1 and others added 11 commits July 7, 2022 06:11
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
…ilterset_model_fields' into timizuo_missing_virtualization_filterset_model_fields
nautobot/virtualization/filters.py Outdated Show resolved Hide resolved
@@ -202,21 +303,74 @@ class VMInterfaceFilterSet(BaseFilterSet, StatusModelFilterSetMixin, CustomField
to_field_name="name",
label="Virtual machine",
)
parent_interface_id = django_filters.ModelMultipleChoiceFilter(
Copy link
Contributor

Choose a reason for hiding this comment

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

Since #1981 didn't remove parent_interface_id and bridge_id from InterfaceFilterSet, we should either leave them in here for now to be self-consistent, or remove them from there as well as a part of this PR.

timizuoebideri1 and others added 2 commits July 12, 2022 21:02
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
@bryanculver bryanculver merged commit 27e7f61 into next Jul 14, 2022
@bryanculver bryanculver deleted the timizuo_missing_virtualization_filterset_model_fields branch August 17, 2022 14:01
@glennmatthews glennmatthews mentioned this pull request Jan 13, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: housekeeping Changes to the application which do not directly impact the end user
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add Missing Model Fields to Virtualization Filter Sets
4 participants