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

Adds support for nested models and array elements in DisplayLookup #140

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Dejiah
Copy link
Contributor

@Dejiah Dejiah commented Dec 30, 2023

fixes #86.

I found a simple way to implement a deep lookup in the object via a path without adding additional dependencies.

The syntax looks like this:

  • fieldName for a plain (not-nested) lookup.
  • arrayField.0 for looking up the 1st element of the array stored in arrayField. Can take .x for looking up the x-th element.
  • nested.attribute_1 for looking up the (nested) field attribute_1 in the top-level attribute nested.
  • any combinations of the above such as nested.arrayField.1.attribute_1

Also, added an example to the demo page for the Users table.

@Dejiah Dejiah changed the title Added support for nested models and arrays in DisplayLookup Adds support for nested models and arrays in DisplayLookup Dec 30, 2023
@Dejiah Dejiah changed the title Adds support for nested models and arrays in DisplayLookup Adds support for nested models and array elements in DisplayLookup Dec 30, 2023
Copy link

codecov bot commented Dec 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nested models
1 participant