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

Support complex joins #5

Open
alonroth opened this issue Apr 10, 2020 · 2 comments
Open

Support complex joins #5

alonroth opened this issue Apr 10, 2020 · 2 comments

Comments

@alonroth
Copy link

Hi,

First of all, thanks for this library, it's been making our life much easier so far while working with GraphQL (Graphene).

I was wondering why this library doesn't support complex joins.

I was able to allow it pretty fast - and I was wondering what I'm missing here - I was just adding the following:

        if hasattr(self.parent_property.primaryjoin, 'clauses'):
            q = q.filter(
                *self.parent_property.primaryjoin.clauses
            )

after:
q = q.filter(self._join_col.in_(param_values))

Thanks

@chanind
Copy link
Collaborator

chanind commented Apr 14, 2020

That seems reasonable to me. Want to open up a PR with this feature?

@Adarsh-Roy
Copy link

Adarsh-Roy commented Aug 12, 2024

This works, but we will have to bypass the validation of relations with something similar to

    def _validate_relation(self):
        criterion, param_keys = self._simple_lazy_clause
        if hasattr(self.parent_property, 'primaryjoin'):
            # Allow complex joins
            return

I'm not sure if that will create some other problems though ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants