We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have these two related models eg:
class Organisation(Base): __tablename__ = "organisations" id = Column(INTEGER, primary_key=True) name = Column(VARCHAR(64)) class User(Base): __tablename__ = "users" id = Column(INTEGER, primary_key=True) name = Column(VARCHAR(64)) email = Column(VARCHAR(64)) organisation_id = Column(Integer, ForeignKey("organisations.id")) organisation = relationship("Organisation")
And then a filter for filtering users:
class UserFilter(Filter): name = Field() email = Field(lookup_operator=ContainsOperator) organisation = Field(field_name="organisation.name") class Meta: model = User
If I then create a query with a join and attempt to apply the filter to the query:
query = db_session.query(User).join(Organisation) my_filter = UserFilter(data={"organisation": "test_org"}, query=query) query = my_filter.apply() print(str(query))
It creates this second joining of the organisations table:
SELECT users.id AS users_id, users.name AS users_name, users.email AS users_email, users.organisation_id AS users_organisation_id FROM users JOIN organisations ON organisations.id = users.organisation_id JOIN organisations ON organisations.id = users.organisation_id WHERE organisations.name = ?
The text was updated successfully, but these errors were encountered:
@TWeatherston thank you for reporting this issue, a fix has been released (version 1.1.3).
Sorry, something went wrong.
elmkarami
Successfully merging a pull request may close this issue.
I have these two related models eg:
And then a filter for filtering users:
If I then create a query with a join and attempt to apply the filter to the query:
It creates this second joining of the organisations table:
The text was updated successfully, but these errors were encountered: