- https://awstip.com/mastering-django-orm-from-models-to-advanced-queries-be22ec26e8bb
-----------------------
Django ORM turns complex database queries into simple Python code. Instead of writing long SQL statements, you can use:
- Basic filters (filter(), exclude(), get()) to find exactly what you need.
- Smart optimisations (select_related(), prefetch_related()) to speed up your app.
- Handy tricks (annotate(), aggregate()) for calculations without extra code.
-------------------------------------
Want to create an admin panel with ease?
Then check out this tutorial to learn how to use Prisma with react-admin to build powerful admin panels fast.
Watch the full tutorial here
https://youtu.be/MMcRLwhmcIs?si=XlWx5_GsKakJ0ioc
Preview of #LittlePrince, a TUI #Mastodon client. God know why I chose that name:) Just toots, no boosts, and threads! Not quite like #mutt yet (see 2nd s.shot), but we're going steady. A shame I had to fight with #ORM's just to drop them and do all just with SQLite. More on that soon. #Rich will provide the TUI experience, unless someone suggests something else :)
Unpopular opinion might be an overhead but I wish most query builder be immutable by default until they process or execute any non building action. Having to clone a query builder because you need to re-use part of it or create a brand new instance seems anti-POLA (Principle of least astonishment)
Am I the only one who prefer to have the Eloquent Model configuration on-model rather than on the application configuration?
JOOQ — не замена Hibernate. Они решают разные проблемы
Последние год-полтора я натыкаюсь на статьи и доклады (особенно в англоязычном сегменте) о том, что JOOQ – это современная и более крутая альтернатива Hibernate. Скажу сразу, что я считаю JOOQ отличной библиотекой (именно библиотекой, а не фреймворком, в отличие от Hibernate). Он прекрасно справляется со своей задачей – работой с SQL в режиме статической типизации, чтобы отловить большинство ошибок на этапе компиляции. Но когда я слышу аргумент, что время Hibernate прошло и пора все писать на JOOQ, для меня это звучит примерно так же, как то, что время реляционных БД прошло и теперь нужно использовать только NoSQL. Звучит смешно? Но по меркам истории буквально вчера такие разговоры велись вполне серьезно. Я думаю, дело кроется в непонимании корневых проблем, которые решают эти два инструмента. Этой статьей я хочу ответить на эти вопросы.
Just discovered that Django doesn't have a median method in its ORM, but found some interesting hack for implementing it https://medium.com/squad-engineering/hack-django-orm-to-calculate-median-and-percentiles-or-make-annotations-great-again-23d24c62a7d0
#django #orm #sql #median
Last week I wrote about incorporating Alembic commands into your own existing CLI application. I have a bit of a follow up on that...
I've been working on a Typer CLI app with a database backend. Each time I need to set up Alembic (for migrations), I need to go back to the docs and learn all the things (again)...
I wanted to see if I could incorporate alembic commands into my own CLI app. At the least, it would let me inject some custom logic and/or command names.
Wasn't quite sure where to start, but eventually I got there...
So I decided to write about it.
https://pythonbynight.com/blog/alembic-migrations-existing-typer-cli
I've been coding with AI a lot lately, and interestingly, I've found I'm not missing an ORM system so far (still in the prototype phase)
With AI auto-generating SQL, models, and upsert/select methods, development speed has really accelerated! ️ #Development #SQL #Programming #ORM
Advanced capabilities include async processing, custom classifications, #ORM-style interaction, and multiple splitting strategies
Specialized for Intelligent Document Processing (#IDP) with modular architecture inspired by #LangChain ecosystem
New blog post about a technique for "deep filtering" of generic foreign keys: https://blog.bmispelon.rocks/articles/2024/2024-11-25-genericforeignkey-deep-filtering.html
Well I have this Medium account and never posted anything on it, so I decided to write up my littletable project. littletable was an experiment in ORMs that I started about 15 years ago, but it has really come in handy in dealing with small data sets and CSVs (up to a few thousand items). https://medium.com/@ptmcg/data-in-the-small-python-package-littletable-combines-in-memory-nosql-orm-with-schemaless-setup-54ea0b24ac6a #python #orm #database #littletable
Earlier in Djangonaut Space we had a great talk by Simon Charette "Demystifying the Django ORM"
A very interesting Q&A followed
The session was recorded, and I hope it'll be published
Photo permission requested by Priya
CC @djangonaut