question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dealing with nested relationships

See original GitHub issue

Hello,

I apologize if this isn’t the right place to ask this question, but I am having a rough time trying to get this package working with nested relationships. I have tried using DRFs built in solution, DRF-Flex-Fields, and Dynamic Rest. None of these options seem to be able to expand my sub-serializers and apply the DRF-Datatables formatting appropriately.

Instead, what is happening is that the nested relationships are being stripped away and only the first layer is being presented within the data:[...] layer that is fed to the datatable.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
neighlydcommented, May 11, 2018

I don’t have much time to work on this, but the two quick and super-dirty options I’ve figured out so far are:

  1. disabling _filter_unused_fields() entirely and allowing a more robust API field filtering package to take over (e.g. DRF-Flex-Fields).

  2. adding col.split('.').pop(0) to line 68 of renderers.py as seen in my fork (warning: I haven’t written a unit test for this yet). This will search the top level of the data tree and maintain all subsequent serializers. It’s quick, it’s dirty, and I hate it, but I don’t really have time to think of a better way to recursively iterate through the data dict and filtering the appropriate fields at the appropriate level (i.e. recreating the Flex-Fields functionality).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nested Relations
The nested relational model is an extension of the relational model in which domains may be either atomic or relation-valued. This allows a...
Read more >
Nested Relational Databases - Rocket Software
Implicit relationship relations make the database schema simpler and allow it to directly reflect the relations between data in the database. The requirement ......
Read more >
The two roles of nested relations in the DASDBS project
Abstract. The paper gives an overview of the nested relational model and its two roles in the Darmstadt Database System (DASDBS) project, which...
Read more >
Nested Relations - AMiner
A nested relation can be decomposed (“flattened”) into a relation ... Nested relations are based on a type constructor for collection types.
Read more >
Normal Form for Sets of Nested Relations - NUS Computing
nested relation is a relation which is either a NF2 relation or a normalized relation. ... The way to handle recursive relationship types...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found