Add Examples to the Lookup Expressions Section. #5140

Closed
opened 2025-12-29 19:24:46 +01:00 by adam · 1 comment
Owner

Originally created by @jmcguir on GitHub (Aug 5, 2021).

Originally assigned to: @jmcguir on GitHub.

Change Type

Addition

Area

REST API

Proposed Changes

When I first used lookup expressions I kind of puzzled on how exactly they worked. It still happens each time I try to use them. I'd like to add some examples to them to make it clearer how they are used.

Add:

GET/api/ipam/vlans/?vid__gt=900

after the Numeric Fields subsection

and add:

GET api/dcim/devices/?name__ic=switch

after the String Fields subsection

and add:

GET api/ipam/vlans/?group_id__n=3203

after the Foreign Keys & Other Fields

I'd like to have them formatted like the example under the subsection "Filtering by Custom Field" looks.

I'm happy to submit a PR on this if approved.

Originally created by @jmcguir on GitHub (Aug 5, 2021). Originally assigned to: @jmcguir on GitHub. ### Change Type Addition ### Area REST API ### Proposed Changes When I first used lookup expressions I kind of puzzled on how exactly they worked. It still happens each time I try to use them. I'd like to add some examples to them to make it clearer how they are used. Add: `GET/api/ipam/vlans/?vid__gt=900` after the Numeric Fields subsection and add: `GET api/dcim/devices/?name__ic=switch` after the String Fields subsection and add: `GET api/ipam/vlans/?group_id__n=3203` after the Foreign Keys & Other Fields I'd like to have them formatted like the example under the subsection "Filtering by Custom Field" looks. I'm happy to submit a PR on this if approved.
adam added the status: acceptedtype: documentation labels 2025-12-29 19:24:46 +01:00
adam closed this issue 2025-12-29 19:24:46 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 5, 2021):

Seems like the best place to add examples would be at the end of this section.

@jeremystretch commented on GitHub (Aug 5, 2021): Seems like the best place to add examples would be at the end of [this section](https://netbox.readthedocs.io/en/stable/rest-api/filtering/#lookup-expressions).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5140