The purpose of this document is to inventory all existing FilterSet
classes within the Nautobot core to identify gaps in declared filters compared to available model fields.
Utilities are being included with core since nautobot.utilities.filters.BaseModelSet
is the bread and butter here and we may very well end up folding all of the primitives from Utilities into Core to streamline the namespace.
- The model field to filter field mapping at
BaseFilterSet.FILTER_DEFAULTS
needs to also include the correct UI widget types in theextra
for the filter mapping - Filter mappings for ALL custom field types should be extended
- For example
TaggableManager
should always be mapped toTagFilter
to obviate the need to definetag
/tags
on every new filterset that requires tags.
- For example
- The base form used should be included by default on the
Meta.form
option. This base form should be what is used as the base form for our UI including its own model field to form field mappings. (Seefield_classes
on that page). - Patterns where
foo_id
(pk) andfoo
(slug) filters are defined should be accounted for automatically, either by automatically doing this for fields with a slug value, or introducing a hybrid pk/slug filter field that can take both without needing to explicitly define them on every new filterset.
- We should consider a pattern to map certain pk/slug related fields that are common such as
site
/site_id
,region
/region_id
etc. ConsiderCircuitFilterSet
as an example.- It does not have a
site
field and instead derivessite
fromterminations__site__slug
- Region similiarly is derived from
terminations__site__region
- It does not have a
- So a "foo_lookup_field" pattern in the filterset meta would be useful here to help reduce boiler plate e.g.:
class CircuitFilterSet:
class Meta:
site_lookup_field = "terminations__site__slug"
region_lookup_field = "terminations__site__region"
- Then if these meta options are defined, the filterset automatically gets
site
andregion
filters without having to explicitly define them.
- In cases where there is a reverse related manager field (such as
Device.interfaces
) aBooleanFilter
withlookup_expr="isnull"
andexclude=True
named withhas_{field_name}
should be automatically generated.
This filter needs to be adapted since there are cases where CharField
filters (such as DeviceFilterSet.name
) do not make any sense as what gets rendered as a DynamicMultipleChoiceField
in many forms. The dynamically generated MultiValueCharField
that gets generated doesn't necessarily map to non-choice-backed fields (e.g. Device.name
)
- As generated, it inherits from
MultipleChoiceFilter
, but this should only be the case it is eligible to havechoices
provided at filter definition time. - A raw char field (like
Device.name
) does not inherently have any choices to from which to choose, so aMultiVarCharFilter
it is incorrect to make it a choice filter unlesschoices
are also provided. - A pattern similar to what we had to do with
ContentTypeFilter
(inherits fromCharFilter
) andContentTypeChoiceFilter
(inherits fromChoiceFilter
) with a common mixin (ContentTypeFilterMixin
) shared between them should be considered here. - This is an important consideration for generating UI fields automatically from filtersets
This should be renamed to NameSlugSearchFilterSetMixin
because it is a mixin.
This filter needs to go away in v2. It is not even used.
Further, it is bad data design to have CharField
with null=True
because this introduces two ways such a field can be considered "empty" (both an empty string or None
). From the Django docs on null
:
Avoid using
null
on string-based fields such asCharField
andTextField
. If a string-based field hasnull=True
, that means it has two possible values for “no data”:NULL
, and the empty string. In most cases, it’s redundant to have two possible values for “no data;” the Django convention is to use the empty string, notNULL
. One exception is when aCharField
has bothunique=True
andblank=True
set. In this situation,null=True
is required to avoid unique constraint violations when saving multiple objects with blank values.
- This filter will likely go away as it is tightly coupled to calling
.get_descendants()
on member objects. If it is not removed, it will need to be replaced with something similar (related to work such as "IPAM objects as trees")
comments
description
provider_network
termination_a
termination_z
terminations
(reverse related field)- Should also include
has_terminations
membership filter
- Should also include
tag
->tags
circuit
(slug/name/cid filter)provider_network
(name/slug filter)pp_info
description
description
portal_url
noc_contact
admin_contact
comments
provider_networks
(reverse related field)- Should also include
has_provider_networks
membership filter
- Should also include
circuits
(reverse related field)- Should also include
has_circuits
membership filter
- Should also include
tag
->tags
circuit_terminations
(reverse related field)- Should also include
has_circuit_terminations
membership filter
- Should also include
comments
description
tag
->tags
termination_a_type
termination_a_id
termination_a
termination_b_type
termination_b_id
termination_b
- So many of these filter fields are pointing to the
filter_device
method. This is broken. We can solve this more generically.
This filterset does not even exist and it should.
cable
cabled
->has_cable
This should be renamed to ConnectionFilterSetMixin
because it is a mixin.
Needs Meta.fields = "__all__"
once DeviceComponentFilterSet
is updated w/ missing fields
device_type
label
description
Needs Meta.fields = "__all__"
once DeviceComponentFilterSet
is updated w/ missing fields
device_type
label
description
rack
device_type
cluster
virtual_chassis
comments
primary_ip4
primary_ip6
consoleports
(reverse related)- And
has_consoleports
- And
consoleserverports
(reverse related)- And
has_consoleserverports
- And
devicebays
(reverse related)- And
has_devicebays
- And
frontports
(reverse related)- And
has_frontports
- And
inventoryitems
(reverse related)- And
has_inventoryitems
- And
parent_bay
(reverse related)- And
has_parent_bay
- And
poweroutlets
(reverse related)- And
has_poweroutlets
- And
powerports
(reverse related)- And
has_powerports
- And
rearports
(reverse related)- And
has_rearports
- And
services
(reverse related)- And
has_services
- And
vc_master_for
(reverse related)- And
has_vc_master_for
- And
role
->device_role
interfaces
should be (reverse related)- And then assert it has ben included
has_interfaces
- And then assert it has ben included
installed_device
label
description
device_type
label
description
Should be renamed to DeviceComponentFilterSetMixin
because it is a mixin.
label
description
tag
->tags
description
devices
(reverse related)- And
has_devices
- And
virtual_machines
(reverse related)- And
has_virtual_machines
- And
-
comments
-
instances
(reverse)- And
has_instances
- And
-
consoleporttemplates
- Should be named
consoleport_templates
- And
has_consoleport_templates
- Should be named
-
consoleserverporttemplates
- Should be named
consoleserverport_templates
- And
has_consoleserverport_templates
- Should be named
-
powerporttemplates
- Should be named
powerport_templates
- And
has_powerport_templates
- Should be named
-
poweroutlettemplates
- Should be named
poweroutlet_templates
- And
has_poweroutlet_templates
- Should be named
-
interfacetemplates
- Should be named
interface_templates
- And
has_interface_templates
- Should be named
-
frontporttemplates
- Should be named
frontport_templates
- And
has_frontport_templates
- Should be named
-
rearporttemplates
- Should be named
rearport_templates
- And
has_rearport_templates
- Should be named
-
devicebaytemplates
- Should be named
devicebay_templates
- And
has_devicebay_templates
- Should be named
tag
->tags
- Each of the related names listed above in missing fields instead has its on method that should be eliminated as the naming is incorrect an
label
description
rear_port
rear_port_position
device_type
label
description
rear_port
rear_port_position
Needs Meta.fields = "__all__"
once DeviceComponentFilterSet
is updated w/ missing fields
lag
untagged_vlan
tagged_vlans
ip_addresses
member_interfaces
(reverse related)- Also
has_member_interfaces
membership filter
- Also
kind
andfilter_kind
method apparently overlaps withtype
. Can we abstract?vlan_id
andvlan
are both calling methods. Why?tag
->tags
device_type
label
description
parent
serial
It's actually perfect! Only change would be to set Meta.fields = "__all__"
.
Should be renamed to PathEndpointFilterSetMixin
because it is a mixin.
napalm_args
description
devices
(reverse related)- And
has_devices
- And
virtual_machines
(reverse related)- And
has_virtual_machines
- And
power_panel
rack
available_power
comments
rack_group
powerfeeds
(reverse related)- And
has_powerfeeds
- And
tag
->tags
Needs Meta.fields = "__all__"
once DeviceComponentFilterSet
is updated w/ missing fields
device_type
label
description
power_port
poweroutlet_templates
(reverse related)- And
has_poweroutlet_templates
membership filter
- And
Needs Meta.fields = "__all__"
once DeviceComponentFilterSet
is updated w/ missing fields
device_type
label
description
comments
devices
(reverse related)- And
has_devices
- And
powerfeed
(reverse related)- Should be called
powerfeeds
(plural) - And
has_powerfeeds
- Should be called
reservations
(reverse related)- And
has_reservations
- And
children
(reverse related)- And
has_children
- And
powerpanel
(reverse related)- Should be called
powerpanels
(plural) - And
has_powerpanels
- Should be called
racks
(reverse related)- And
has_racks
- And
rack
description
tag
->tags
description
racks
(reverse related)- And
has_racks
- And
label
description
frontports
(reverse related)- And
has_frontports
membership filter
- And
device_type
label
description
frontport_templates
(reverse related)- And
has_frontport_templates
membership filter
- And
It's actually perfect! Only change would be to set Meta.fields = "__all__"
.
children
(reverse related)- And
has_children
- And
sites
(reverse related)- And
has_sites
- And
comments
time_zone
physical_address
shipping_address
circuit_terminations
(reverse related)- And
has_circuit_terminations
- And
devices
(reverse related)- And
has_devices
- And
powerpanel
(reverse related)- Should be named
powerpanels
- And
has_powerpanels
- Should be named
rack_groups
(reverse related)- And
has_rack_groups
- And
racks
(reverse related)- And
has_racks
- And
prefixes
(reverse related)- And
has_prefixes
- And
vlan_groups
(reverse related)- And
has_vlan_groups
- And
vlans
(reverse related)- And
has_vlans
- And
clusters
(reverse related)- And
has_clusters
- And
tag
->tags
It's actually perfect! Only change would be to set Meta.fields = "__all__"
.
label
description
advanced_ui
(boolean)- And
has_advanced_ui
- And
owner
weight
description
schema
region
-> `regionssite
->sites
role
->roles
platform
->platforms
cluster_group
->cluster_groups
tenant_group
->tenant_groups
tenant
->tenants
device_type
->device_types
tag
->tags
slug
data_schema
owner_content_type
owner_object_id
owner
device_set
(reverse related)- Should be called
devices
- And add
has_devices
- Should be called
configcontext_set
->config_contexts
- Should be called
config_contexts
- And add
has_config_contexts
- Should be called
virtualmachine_set
(reverse related)- Should be called
virtual_machines
- And add
has_virtual_machines
- Should be called
device_set
->devices
configcontext_set
->config_contexts
virtualmachine_set
->virtual_machines
It's actually perfect! Only change would be to set Meta.fields = "__all__"
.
type
description
default
label
validation_minimum
validation_maximum
validation_regex
advanced_ui
choices
(reverse related)- And
has_choices
- And
It's actually perfect! Only change would be to set Meta.fields = "__all__"
.
Should be renamed to CreatedUpdatedFilterSetMixin
because it is a mixin.
It's actually perfect! Only change would be to set Meta.fields = "__all__"
.
owner
description
template_code
mime_type
file_extension
current_head
provided_contents
username
jobs
(reverse related)- And
has_jobs
- And
tag
->tags
query
variables
parent
image_height
image_width
created
git_repository
description
results
(reverse related)- And
has_results
- And
scheduled_jobs
(reverse related)- And
has_scheduled_jobs
- And
tag
->tags
Meta.exclude = []
should be exchanged for Meta.fields = "__all__"
data
schedule
job_id
logs
(reverse related)- And
has_logs
- And
related_object_type
related_object_id
realted_object
object_repr
object_data
object_data_v2
slug
description
source_label
source_hidden
source_filter
destination_label
destination_hidden
destination_filter
advanced_ui
associations
(reverse related)- And
has_associations
- And
source
destination
Too many to list:
In [187]: RelationshipAssociation._meta.fields_map
Out[187]:
{'source_circuits_providernetwork': <GenericRel: circuits.providernetwork>,
'destination_circuits_providernetwork': <GenericRel: circuits.providernetwork>,
'source_circuits_provider': <GenericRel: circuits.provider>,
'destination_circuits_provider': <GenericRel: circuits.provider>,
'source_circuits_circuittype': <GenericRel: circuits.circuittype>,
'destination_circuits_circuittype': <GenericRel: circuits.circuittype>,
'source_circuits_circuit': <GenericRel: circuits.circuit>,
'destination_circuits_circuit': <GenericRel: circuits.circuit>,
'source_circuits_circuittermination': <GenericRel: circuits.circuittermination>,
'destination_circuits_circuittermination': <GenericRel: circuits.circuittermination>,
'source_dcim_consoleport': <GenericRel: dcim.consoleport>,
'destination_dcim_consoleport': <GenericRel: dcim.consoleport>,
'source_dcim_consoleserverport': <GenericRel: dcim.consoleserverport>,
'destination_dcim_consoleserverport': <GenericRel: dcim.consoleserverport>,
'source_dcim_powerport': <GenericRel: dcim.powerport>,
'destination_dcim_powerport': <GenericRel: dcim.powerport>,
'source_dcim_poweroutlet': <GenericRel: dcim.poweroutlet>,
'destination_dcim_poweroutlet': <GenericRel: dcim.poweroutlet>,
'source_dcim_interface': <GenericRel: dcim.interface>,
'destination_dcim_interface': <GenericRel: dcim.interface>,
'source_dcim_frontport': <GenericRel: dcim.frontport>,
'destination_dcim_frontport': <GenericRel: dcim.frontport>,
'source_dcim_rearport': <GenericRel: dcim.rearport>,
'destination_dcim_rearport': <GenericRel: dcim.rearport>,
'source_dcim_devicebay': <GenericRel: dcim.devicebay>,
'destination_dcim_devicebay': <GenericRel: dcim.devicebay>,
'source_dcim_inventoryitem': <GenericRel: dcim.inventoryitem>,
'destination_dcim_inventoryitem': <GenericRel: dcim.inventoryitem>,
'source_dcim_manufacturer': <GenericRel: dcim.manufacturer>,
'destination_dcim_manufacturer': <GenericRel: dcim.manufacturer>,
'source_dcim_devicetype': <GenericRel: dcim.devicetype>,
'destination_dcim_devicetype': <GenericRel: dcim.devicetype>,
'source_dcim_devicerole': <GenericRel: dcim.devicerole>,
'destination_dcim_devicerole': <GenericRel: dcim.devicerole>,
'source_dcim_platform': <GenericRel: dcim.platform>,
'destination_dcim_platform': <GenericRel: dcim.platform>,
'source_dcim_device': <GenericRel: dcim.device>,
'destination_dcim_device': <GenericRel: dcim.device>,
'source_dcim_virtualchassis': <GenericRel: dcim.virtualchassis>,
'destination_dcim_virtualchassis': <GenericRel: dcim.virtualchassis>,
'source_dcim_cable': <GenericRel: dcim.cable>,
'destination_dcim_cable': <GenericRel: dcim.cable>,
'source_dcim_consoleporttemplate': <GenericRel: dcim.consoleporttemplate>,
'destination_dcim_consoleporttemplate': <GenericRel: dcim.consoleporttemplate>,
'source_dcim_consoleserverporttemplate': <GenericRel: dcim.consoleserverporttemplate>,
'destination_dcim_consoleserverporttemplate': <GenericRel: dcim.consoleserverporttemplate>,
'source_dcim_powerporttemplate': <GenericRel: dcim.powerporttemplate>,
'destination_dcim_powerporttemplate': <GenericRel: dcim.powerporttemplate>,
'source_dcim_poweroutlettemplate': <GenericRel: dcim.poweroutlettemplate>,
'destination_dcim_poweroutlettemplate': <GenericRel: dcim.poweroutlettemplate>,
'source_dcim_interfacetemplate': <GenericRel: dcim.interfacetemplate>,
'destination_dcim_interfacetemplate': <GenericRel: dcim.interfacetemplate>,
'source_dcim_frontporttemplate': <GenericRel: dcim.frontporttemplate>,
'destination_dcim_frontporttemplate': <GenericRel: dcim.frontporttemplate>,
'source_dcim_rearporttemplate': <GenericRel: dcim.rearporttemplate>,
'destination_dcim_rearporttemplate': <GenericRel: dcim.rearporttemplate>,
'source_dcim_devicebaytemplate': <GenericRel: dcim.devicebaytemplate>,
'destination_dcim_devicebaytemplate': <GenericRel: dcim.devicebaytemplate>,
'source_dcim_powerpanel': <GenericRel: dcim.powerpanel>,
'destination_dcim_powerpanel': <GenericRel: dcim.powerpanel>,
'source_dcim_powerfeed': <GenericRel: dcim.powerfeed>,
'destination_dcim_powerfeed': <GenericRel: dcim.powerfeed>,
'source_dcim_rackgroup': <GenericRel: dcim.rackgroup>,
'destination_dcim_rackgroup': <GenericRel: dcim.rackgroup>,
'source_dcim_rackrole': <GenericRel: dcim.rackrole>,
'destination_dcim_rackrole': <GenericRel: dcim.rackrole>,
'source_dcim_rack': <GenericRel: dcim.rack>,
'destination_dcim_rack': <GenericRel: dcim.rack>,
'source_dcim_rackreservation': <GenericRel: dcim.rackreservation>,
'destination_dcim_rackreservation': <GenericRel: dcim.rackreservation>,
'source_dcim_region': <GenericRel: dcim.region>,
'destination_dcim_region': <GenericRel: dcim.region>,
'source_dcim_site': <GenericRel: dcim.site>,
'destination_dcim_site': <GenericRel: dcim.site>,
'source_ipam_vrf': <GenericRel: ipam.vrf>,
'destination_ipam_vrf': <GenericRel: ipam.vrf>,
'source_ipam_routetarget': <GenericRel: ipam.routetarget>,
'destination_ipam_routetarget': <GenericRel: ipam.routetarget>,
'source_ipam_rir': <GenericRel: ipam.rir>,
'destination_ipam_rir': <GenericRel: ipam.rir>,
'source_ipam_aggregate': <GenericRel: ipam.aggregate>,
'destination_ipam_aggregate': <GenericRel: ipam.aggregate>,
'source_ipam_role': <GenericRel: ipam.role>,
'destination_ipam_role': <GenericRel: ipam.role>,
'source_ipam_prefix': <GenericRel: ipam.prefix>,
'destination_ipam_prefix': <GenericRel: ipam.prefix>,
'source_ipam_ipaddress': <GenericRel: ipam.ipaddress>,
'destination_ipam_ipaddress': <GenericRel: ipam.ipaddress>,
'source_ipam_vlangroup': <GenericRel: ipam.vlangroup>,
'destination_ipam_vlangroup': <GenericRel: ipam.vlangroup>,
'source_ipam_vlan': <GenericRel: ipam.vlan>,
'destination_ipam_vlan': <GenericRel: ipam.vlan>,
'source_ipam_service': <GenericRel: ipam.service>,
'destination_ipam_service': <GenericRel: ipam.service>,
'source_extras_status': <GenericRel: extras.status>,
'destination_extras_status': <GenericRel: extras.status>,
'source_extras_tag': <GenericRel: extras.tag>,
'destination_extras_tag': <GenericRel: extras.tag>,
'source_extras_gitrepository': <GenericRel: extras.gitrepository>,
'destination_extras_gitrepository': <GenericRel: extras.gitrepository>,
'source_extras_dynamicgroup': <GenericRel: extras.dynamicgroup>,
'destination_extras_dynamicgroup': <GenericRel: extras.dynamicgroup>,
'source_extras_job': <GenericRel: extras.job>,
'destination_extras_job': <GenericRel: extras.job>,
'source_extras_configcontextschema': <GenericRel: extras.configcontextschema>,
'destination_extras_configcontextschema': <GenericRel: extras.configcontextschema>,
'source_extras_exporttemplate': <GenericRel: extras.exporttemplate>,
'destination_extras_exporttemplate': <GenericRel: extras.exporttemplate>,
'source_extras_secret': <GenericRel: extras.secret>,
'destination_extras_secret': <GenericRel: extras.secret>,
'source_extras_secretsgroup': <GenericRel: extras.secretsgroup>,
'destination_extras_secretsgroup': <GenericRel: extras.secretsgroup>,
'source_tenancy_tenantgroup': <GenericRel: tenancy.tenantgroup>,
'destination_tenancy_tenantgroup': <GenericRel: tenancy.tenantgroup>,
'source_tenancy_tenant': <GenericRel: tenancy.tenant>,
'destination_tenancy_tenant': <GenericRel: tenancy.tenant>,
'source_virtualization_clustertype': <GenericRel: virtualization.clustertype>,
'destination_virtualization_clustertype': <GenericRel: virtualization.clustertype>,
'source_virtualization_clustergroup': <GenericRel: virtualization.clustergroup>,
'destination_virtualization_clustergroup': <GenericRel: virtualization.clustergroup>,
'source_virtualization_cluster': <GenericRel: virtualization.cluster>,
'destination_virtualization_cluster': <GenericRel: virtualization.cluster>,
'source_virtualization_virtualmachine': <GenericRel: virtualization.virtualmachine>,
'destination_virtualization_virtualmachine': <GenericRel: virtualization.virtualmachine>,
'source_virtualization_vminterface': <GenericRel: virtualization.vminterface>,
'destination_virtualization_vminterface': <GenericRel: virtualization.vminterface>}
description
task
job_class
interval
args
kwargs
queue
one_off
start_time
enabled
total_run_count
user
approved_by_user
approval_required
approved_at
jobresult_set
(reverse related)- Should be named
job_results
(fromJobResult.schedule.related_name
being set) - Also add
has_job_results
- Should be named
last_run
->last_run_at
It's actually perfect! Only change would be to set Meta.fields = "__all__"
.
parameters
groups
(reverse related)- And
has_groups
- And
secretsgroupassociation_set
(reverse related)- Should be
secrets_groups
- And
has_secrets_groups
- Should be
secrets
(m2m)device_set
(reverse related)- Should be called
devices
- And
has_devices
- Should be called
gitrepository_set
(reverse related)- Should be called
git_repositories
- And
has_git_repositories
- Should be called
secretsgroupassociation
(reverse related)- Should be called
secrets
- And
has_secrets
- Should be called
description
circuits_circuit_related
(reverse related)- And
has_circuits_circuit_related
- And
dcim_cable_related
(reverse related)- And
has_dcim_cable_related
- And
dcim_device_related
(reverse related)- And
has_dcim_device_related
- And
dcim_powerfeed_related
(reverse related)- And
has_dcim_powerfeed_related
- And
dcim_rack_related
(reverse related)- And
has_dcim_rack_related
- And
dcim_site_related
(reverse related)- And
has_dcim_site_related
- And
ipam_ipaddress_related
(reverse related)- And
has_ipam_ipaddress_related
- And
ipam_prefix_related
(reverse related)- And
has_ipam_prefix_related
- And
ipam_vlan_related
(reverse related)- And
has_ipam_vlan_related
- And
virtualization_virtualmachine_related
(reverse related)- And
has_virtualization_virtualmachine_related
- And
description
See also (related_name
needs to be added to whatever this is vs. foo_set
):
In [201]: Tag._meta.fields_map
Out[201]:
{'providernetwork': <ManyToManyRel: circuits.providernetwork>,
'provider': <ManyToManyRel: circuits.provider>,
'circuit': <ManyToManyRel: circuits.circuit>,
'circuittermination': <ManyToManyRel: circuits.circuittermination>,
'consoleport': <ManyToManyRel: dcim.consoleport>,
'consoleserverport': <ManyToManyRel: dcim.consoleserverport>,
'powerport': <ManyToManyRel: dcim.powerport>,
'poweroutlet': <ManyToManyRel: dcim.poweroutlet>,
'interface': <ManyToManyRel: dcim.interface>,
'frontport': <ManyToManyRel: dcim.frontport>,
'rearport': <ManyToManyRel: dcim.rearport>,
'devicebay': <ManyToManyRel: dcim.devicebay>,
'inventoryitem': <ManyToManyRel: dcim.inventoryitem>,
'devicetype': <ManyToManyRel: dcim.devicetype>,
'device': <ManyToManyRel: dcim.device>,
'virtualchassis': <ManyToManyRel: dcim.virtualchassis>,
'cable': <ManyToManyRel: dcim.cable>,
'powerpanel': <ManyToManyRel: dcim.powerpanel>,
'powerfeed': <ManyToManyRel: dcim.powerfeed>,
'rack': <ManyToManyRel: dcim.rack>,
'rackreservation': <ManyToManyRel: dcim.rackreservation>,
'site': <ManyToManyRel: dcim.site>,
'vrf': <ManyToManyRel: ipam.vrf>,
'routetarget': <ManyToManyRel: ipam.routetarget>,
'aggregate': <ManyToManyRel: ipam.aggregate>,
'prefix': <ManyToManyRel: ipam.prefix>,
'ipaddress': <ManyToManyRel: ipam.ipaddress>,
'vlan': <ManyToManyRel: ipam.vlan>,
'service': <ManyToManyRel: ipam.service>,
'Tag_content_types+': <ManyToOneRel: extras.tag_content_types>,
'extras_taggeditem_items': <ManyToOneRel: extras.taggeditem>,
'gitrepository': <ManyToManyRel: extras.gitrepository>,
'job': <ManyToManyRel: extras.job>,
'ConfigContext_tags+': <ManyToOneRel: extras.configcontext_tags>,
'_extras_configcontext_tags_+': <ManyToManyRel: extras.configcontext>,
'secret': <ManyToManyRel: extras.secret>,
'tenant': <ManyToManyRel: tenancy.tenant>,
'cluster': <ManyToManyRel: virtualization.cluster>,
'virtualmachine': <ManyToManyRel: virtualization.virtualmachine>,
'vminterface': <ManyToManyRel: virtualization.vminterface>}
http_method
http_content_type
additional_headers
body_template
secret
ssl_verification
ca_file_path
network
broadcast
prefix_length
description
tag
->tags
host
broadcast
prefix_length
assigned_object
nat_inside
nat_outside_list
- Should also include
has_nat_outside_list
?
- Should also include
primary_ip4_for
(onDevice.name
)primary_ip6_for
(onDevice.name
)services
(reverse related)- Should also include
has_services
- Should also include
mask_length
( and__gte/__lte
) should just be replaced withprefix_length
and support multiple lookup expressions without resorting to method fiilters- Automatically generating
lt
,gt
, etc for these is ideal which when NOT a method filter happens automatically (See:nautobot.utilities.constants.FILTER_NUMERIC_BASED_LOOKUP_MAP
)
- Automatically generating
present_in_vrf_id
should behas_vrf
on thevrf__rd
fieldassigned_to_interface
->is_assigned_to_interface
interface
related name should instead be calledinterfaces
as it is a FK related managervminterface
related name should instead be calledvimnterfaces
as it is a FK related managertag
->tags
network
broadcast
prefix_length
description
tag
->tags
present_in_vrf_id
should behas_vrf
on thevrf__rd
fieldvlan_vid
should just be caleldvlan
and search on thevid
usingto_field_name
mask_length
( and__gte/__lte
) should just be replaced withprefix_length
and support multiple lookup expressions without resorting to method fiilters- Automatically generating
lt
,gt
, etc for these is ideal which when NOT a method filter happens automatically (See:nautobot.utilities.constants.FILTER_NUMERIC_BASED_LOOKUP_MAP
)
- Automatically generating
It's actually perfect! Only change would be to set Meta.fields = "__all__"
.
-
description
-
weight
-
prefixes
(reverse related)- Also add
has_prefixes
membership filter
- Also add
-
vlans
(reverse related)- Also add
has_vlans
membership filter
- Also add
ipaddresses
(m2m)
port
->ports
tag
->tags
description
exporting_vrf
->exporting_vrfs
importing_vrf
->importing_vrfs
tag
->tags
description
interfaces_as_untagged
interfaces_as_tagged
vminterfaces_as_untagged
vminterfaces_as_tagged
prefixes
(reverse related)- Also add
has_prefixes
membership filter
- Also add
tag
->tags
Almost all fields accounted for!
vlans
(reverse related)- Also add
has_vlans
membership filter
- Also add
description
prefixes
(reverse related field)- Should also include
has_prefixes
membership filter
- Should also include
ip_addresses
(reverse related field)- Should also include
has_ip_addresses
membership filter
- Should also include
tag
->tags
import_target
->import_targets
export_target
->export_targets
children
(reverse related field)- Should also include
has_children
membership filter
- Should also include
tenants
(reverse related field)- Should also include
has_tenants
membership filter
- Should also include
-
description
-
comments
-
aggregates
- And
has_aggregates
- And
-
circuits
- And
has_circuits
- And
-
clusters
- And
has_clusters
- And
-
devices
- And
has_devices
- And
-
ip_addresses
- And
has_ip_addresses
- And
-
prefixes
- And
has_prefixes
- And
-
rackreservations
- Should be called
rack_reservations
(this is a related_name problem) - And
has_rack_reservations
- Should be called
-
racks
- And
has_racks
- And
-
route_targets
- And
has_route_targets
- And
-
sites
- And
has_sites
- And
-
virtual_machines
- And
has_virtual_machines
- And
-
vlans
- And
has_vlans
- And
-
vrfs
- And
has_vrfs
- And
tag
->tags
Should be renamed to TenancyFilterSetMixin
because it is a mixin.
config_data
changes
(reverse related)- And
has_changes
- And
logentry_set
(reverse related)- And
has_logentry_set
- And
object_permissions
(reverse related)- And
has_object_permissions
- And
rackreservation_set
(reverse related)- Should be called
rack_reservations
- And
has_rack_reservations
- Should be called
social_auth
(reverse related)- And
has_social_auth
- And
tokens
(reverse related)- And
has_tokens
- And
description
constraints
actions
group
->groups
user
->users
description
comments
devices
(reverse related)- And
has_devices
- And
virtual_machines
(reverse related)- And
has_virtual_machines
- And
tag
->tags
clusters
(reverse related)- And
has_clusters
- And
clusters
(reverse related)- And
has_clusters
- And
comments
primary_ip4
primary_ip6
services
(reverse related)- And
has_services
- And
interfaces
(reverse related)- And
has_interfaces
- And
description
untagged_vlan
tagged_vlans
ip_addresses
mode
tag
->tags