You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off; A big thank you to the people who have contributed to making both pyeve and eve-sqlalchemy! Fantastic tools!
the eve-sqlAlchemy docs state the following: With this version of Eve you can use SQLAlchemy expressions such as: like, in, any, etc.
This question pertains to the "etc" part. I would like to query a stock history for the most recent transaction for each article type in stock history. The docs refer to the SA documentation SQLAlchemy internals for an elaboration on the etc part.
I found a distinct() expression in the referenced documentation. Reading some more of the sqlalchemy docs I fear that this is not an expression that would be of help in my specific case. But I would like to double check with you guys just to be sure.
I have tried a range of different query syntax. This one;
http://"domain-or-ip"/stock?where={"article":"distinct('article')"} returns an empty xml file. The fact that it is not throwing an error message was the reason why I thought it migth be ok to ask this question here.
I hope this question is not out of bounds and would like to extend my gratitude in advance, to any answer, regardless of whether or not the answer is of help!
The text was updated successfully, but these errors were encountered:
I'm afraid the "easiest" way to support this request would be to add a custom endpoint (e.g. with a Flask blueprint). Using DISTINCT alone would not give you the desired results anyway, you would need to group by article type to be able to use MAX on the date.
Unfortunately getting the query right will not help you with rendering the response properly (and adhering to all those Eve settings like pagination).
@nicolaiarocci Do you happen to have a good recipe for adding custom read-only endpoints to Eve where the only customization is the selection which records to show? I just did a quick research and it seems not too many people are asking for this, so maybe it's obvious and I'm missing something here.
First off; A big thank you to the people who have contributed to making both pyeve and eve-sqlalchemy! Fantastic tools!
the eve-sqlAlchemy docs state the following:
With this version of Eve you can use SQLAlchemy expressions such as: like, in, any, etc.
This question pertains to the "etc" part. I would like to query a stock history for the most recent transaction for each article type in stock history. The docs refer to the SA documentation SQLAlchemy internals for an elaboration on the etc part.
I found a distinct() expression in the referenced documentation. Reading some more of the sqlalchemy docs I fear that this is not an expression that would be of help in my specific case. But I would like to double check with you guys just to be sure.
I have tried a range of different query syntax. This one;
http://"domain-or-ip"/stock?where={"article":"distinct('article')"} returns an empty xml file. The fact that it is not throwing an error message was the reason why I thought it migth be ok to ask this question here.
I hope this question is not out of bounds and would like to extend my gratitude in advance, to any answer, regardless of whether or not the answer is of help!
The text was updated successfully, but these errors were encountered: