Allow for querying descendants - children recursively
See original GitHub issueThere is a need for this expressed https://www.getlektor.com/docs/api/db/record/children/ and on gitter.
To be clear, instead of returning only the direct, 1st generation children of a record, descendants would be recursive for the entire depth of the record and return all children of all depths.
We already have this.children recursive
, but I think descendants still has a use, as it allows you to chain methods together more easily.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Getting all descendants of a parent - DBA Stack Exchange
According to the docs, Teiid does support recursive queries, you just need to omit the keyword RECURSIVE. (And while we are at it,...
Read more >How to Get Descendants of a Parent in SQL | LearnSQL.com
Recursive Query : Retrieving the Descendants. First, let me show you what the query looks like. Then I'll break it down for you, ......
Read more >Recursive query for parent child hierarchy. Get descendants ...
The below query will give you all the Parent - Child relationships that are descendants of 3. CREATE TABLE dbo.ParentChildRel ( Parent INT ......
Read more >3.1.2 Example 2: Descendant - CS @ Union
Prolog has found a proof for the goal descend(caroline,laura) (the second recursive call). But this means that child(charlotte,laura) (the first recursive call) ...
Read more >Hierarchical (Recursive) Queries in Valentina SQL
Let `s assume that we have a table with a self-recursive link: some record(s) as the parent record(s), and child-records having pointers to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’d like to see glob patterns working in queries, and this would solve this here issue.
would be equivalent to the current behaviour.
But
would fetch everything recursively.
true that would solve this exact issue and something like that is what I currently plan on doing.
now what about say, blog categories with sub categories?
e.g.
I want not only ‘blog-categories’ but as well it’s sub categories.
something is missing, yes, if there is just one level of blog categories it works. But bad luck to you if you want to do something slightly different.
what about you want a resource in a different place than
/resources
as well? Say I have some videos as well in/training
I already tried you cannot define the slug to be../training/something
that was btw one of the first things I tried with lektor.the question: “get me all
video records
” can only be solved in the view via recursive function calls. I don’t think thats cool.I say I want to query all records never matter where they are. And I want to have them available on model definition level. If it’s only available on view level, it limits in what I can do with it. And I want to run actually nice queries over all records. That is not something insane to ask for imho. By all means, if there is a way to achieve it, please tell me.
as soon as the structure gets a little bit more complex, the records are a bit spread out, the air gets really thin for lektor. And that wasn’t clear to me to begin with. And I don’t think it’s cool. It should be simple and fun to work with lektor.
On 19 September 2017 at 12:39, Andreas Runfalk notifications@github.com wrote: