You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a table similar to what is described in community #1495 , although in my scenario, I have the following schema:
Objectives
type - choice e.g. project, task
title - text field
parent - a self reference to the objectives table
as formula reference lists aren't supported as two way references these are included:
links_from - a two way reference list
links_to - the other two way reference list
Links
from - reference field to objectives
link - text explaining the link
to - reference field to objectives
links - a formula reference list joining the $from and $to fields as described in the community post
I have one use case that requires two joins, I'd like a reference list on Objectives that includes links of itself AND links of it's parent (chain). I would need to join links_from and links_to into a single reference list $links on Objectives first then join $parent.links and $links into $all_links together.
This is possible with nested list comprehension but it's not intuitive and could be simpler!
Describe the solution you would like
Overriding the __add__ operator in python record.RecordSet might work and it would result in formula like this:
$links: $links_to + $links_from
$all_links: $parent.links + $links
rather than this:
$links: { el for sublist in [$links_to, $links_from] for el in sublist }
$all_links: { el for sublist in [$parent.all_links, $links] for el in sublist }
The text was updated successfully, but these errors were encountered:
One is that in addition to the list-comprehension approach, you can also use set($links_to) | set($links_from) (when you want to remove any duplicates and order doesn't natter) or list($links_to) + list($links_from (when you want to keep duplicates and order).
The other note is that a there was an improvement last year to a related issue reported here: #1130. If adding an __add__ operator, it would make sense to match that behavior (which takes care of preserving order, but removing duplicates, see here).
Describe the problem to be solved
Refs:
I've got a table similar to what is described in community #1495 , although in my scenario, I have the following schema:
Objectives
as formula reference lists aren't supported as two way references these are included:
Links
I have one use case that requires two joins, I'd like a reference list on Objectives that includes links of itself AND links of it's parent (chain). I would need to join
links_from
andlinks_to
into a single reference list$links
on Objectives first then join$parent.links
and$links
into$all_links
together.This is possible with nested list comprehension but it's not intuitive and could be simpler!
Describe the solution you would like
Overriding the
__add__
operator in pythonrecord.RecordSet
might work and it would result in formula like this:$links
:$links_to + $links_from
$all_links
:$parent.links + $links
rather than this:
$links
:{ el for sublist in [$links_to, $links_from] for el in sublist }
$all_links
:{ el for sublist in [$parent.all_links, $links] for el in sublist }
The text was updated successfully, but these errors were encountered: