Conversation
7afa03c to
a6ec0a5
Compare
Member
|
This seems basically plausible; could you post some of the generated model code here? |
10139fb to
a98a638
Compare
e4582d6 to
6c2ed38
Compare
4a20778 to
3d482e1
Compare
Contributor
Author
|
In All other backlinks classes derive from class __BaseObject_backlinks__(GelObjectBacklinksModel):
class __gel_reflection__(GelObjectBacklinksModel.__gel_reflection__):
name = SchemaPath.from_segments('std', 'BaseObject')
type_name = SchemaPath.from_segments('std', 'BaseObject')
@LazyClassProperty["dict[builtins.str, GelPointerReflection]"]
@classmethod
def pointers(cls,) -> dict[builtins.str, GelPointerReflection]:
my_ptrs: dict[builtins.str, GelPointerReflection] = {}
return my_ptrsWhich is added to class BaseObject(...):
...
__backlinks__: GelObjectBacklinksModelDescriptor[__BaseObject_backlinks__] = GelObjectBacklinksModelDescriptor[__BaseObject_backlinks__]()
...For user defined types, an object class __Inh_A_backlinks__(std_shapes.__Object_backlinks__):
class __gel_reflection__(
std_shapes.__Object_backlinks__.__gel_reflection__
):
name = SchemaPath.from_segments('default', 'Inh_A')
type_name = SchemaPath.from_segments('default', 'Inh_A')
@LazyClassProperty["dict[str, GelPointerReflection]"]
@classmethod
def pointers(cls,) -> dict[str, GelPointerReflection]:
my_ptrs: dict[str, GelPointerReflection] = {
'l': GelPointerReflection(
name='l',
type=std_shapes.BaseObject,
kind=PointerKind('Link'),
cardinality=Cardinality('Many'),
computed=True,
readonly=True,
has_default=False,
mutable=False,
properties=None,
),
}
return (
my_ptrs
| std_shapes.__Object_backlinks__.__gel_reflection__.pointers
)
l: ComputedMultiLink[std_shapes.BaseObject]
...
class Inh_A(...):
__backlinks__: GelObjectBacklinksModelDescriptor[__Inh_A_backlinks__] = GelObjectBacklinksModelDescriptor[__Inh_A_backlinks__]()
... |
msullivan
approved these changes
Nov 4, 2025
| base_backlinks_reflections: list[str] | ||
| base_backlinks_models: list[str] | ||
|
|
||
| if objtype.name == "std::BaseObject": |
Member
There was a problem hiding this comment.
comment on why this is special?
|
|
||
| backlinks_model_name = self._mangle_backlinks_model_name(name) | ||
|
|
||
| base_object_types = [ |
Member
There was a problem hiding this comment.
Maybe a name change here or a comment, but there is a bunch of code here dealing with both the base types of the current object and also BaseObject, and it's a little confusing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Object models now have a
__backlinks__field, which is set to aGelObjectBacklinksModel. This backlinks model contains multi links tostd::BaseObject.These new backlinks models are generated during reflection. At runtime, intersections generate a backlink model alongside the intersection type.
A simple query with backlinks:
A more complex query with backlinks:
Also works inside shapes: