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 run into the problem that, exclude to field relation, it does not do so.
First Model
class User(BaseModel): id = Column(Integer, primary_key=True, autoincrement=True) name = Column(String(100), index=True) shopping_carts = relationship( 'ShoppingCart', uselist=True, back_populates='user' )
Second Model
class ShoppingCart(BaseModel): id = Column(Integer, primary_key=True, autoincrement=True) user_id = Column(Integer, ForeignKey('users.id')) user = relationship( 'User', uselist=False, back_populates='shopping_carts' )
Use smart query.
The text was updated successfully, but these errors were encountered:
@jeandelacruz Do you mind adding an example of the query you are running, what's being returned, and what's expected to be returned?
Sorry, something went wrong.
This code:
records = self.model.smart_query( filters={**filters}, sort_attrs=['id'], schema={ 'role': JOINED, 'shopping_carts': JOINED } ).paginate( per_page=query.per_page, page=query.page ) return jsonify(results=records.to_dict(nested=True, exclude=['shopping_carts']))
Results:
Expected returned:
No branches or pull requests
I have run into the problem that, exclude to field relation, it does not do so.
First Model
Second Model
Use smart query.
The text was updated successfully, but these errors were encountered: