Question: how to get a list of values from a queryset? #222
-
I want to get the list of records ids with a filtered attribute (to be able to pick a random one among them later). In Django ORM, I would do something like: In SQL Alchemy, something like https://stackoverflow.com/questions/24560945/sqlalchemy-get-list-of-ids-from-a-query How to do that with Ormar? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Right now there is no way to return the raw data from a query bypassing the model -> sounds like an enhancement idea. So for now you would have to do Note that if you have other fields optional you can select only id i.e. |
Beta Was this translation helpful? Give feedback.
-
Added in 0.10.11 |
Beta Was this translation helpful? Give feedback.
Added in 0.10.11