4 ms·
I am very happy with ORM. I'm currently working on an e-shop. I need to display many tables with different filters. Administrator wants products starting with
by mireq 7y ago
I am very happy with ORM.
I'm currently working on an e-shop. I need to display many tables with different filters.
Administrator wants products starting with string? OK: if filter['category']: qs = qs.filter ...
Administrator wants products without category? Ok: if filter['category']: qs = qs.filter ...
Add multilang supprt? Ok: subclass model, mark fields and translatable, run migrate script
I can combine any filters, ORM automatically creats query with necessary joins, subqueries, group by expressions etc.
If i didn't use ORM i would have to write code that generate select with cca 200 ifs because almost every filter can generate join or add fields to group by or generate subselect etc.
- scarface74 7y agoThis is about the only use case where I find ORMs useful