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

[BUG] Multilevel related document lookups don't work #877

Open
thorin-schiffer opened this issue Feb 21, 2024 · 1 comment
Open

[BUG] Multilevel related document lookups don't work #877

thorin-schiffer opened this issue Feb 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@thorin-schiffer
Copy link

thorin-schiffer commented Feb 21, 2024

Describe the bug
If document referencing goes further than one level, find won't resolve it properly

To Reproduce

class Organization(Document):
    slug: str

class Domain(Document):
    organization: Link[Organization]
    integration: str

class Attribute(Document):
    domain: Link[Domain]

class AttributeMapping(Document):
    source: Link[Attribute]
    target: Link[Attribute]

# won't work
await AttributeMapping.find(
            AttributeMapping.source.domain.integration == domain.integration,
            AttributeMapping.source.domain.organization.slug == organization.slug,
            fetch_links=True,
        ).count()

# won't work
await AttributeMapping.find(
            AttributeMapping.source.domain.id == domain.id,
            fetch_links=True, # regardless
        ).count()

Expected behavior
Linked documents are found

@roman-right roman-right added the bug Something isn't working label Feb 26, 2024
@roman-right
Copy link
Member

Hi! I'll check what is going on there and will let you know here if this is possible to fix or not. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants