←back to thread

Happy 20th Birthday, Django

(www.djangoproject.com)
578 points davepeck | 1 comments | | HN request time: 0.239s | source
Show context
Euphorbium ◴[] No.44559640[source]
Fastapi has completely replaced django for me. I do not miss orm at all.
replies(3): >>44559711 #>>44559962 #>>44561110 #
lutoma ◴[] No.44559962[source]
I’ve also switched away from Django (to Litestar), but the ORM is the mean thing I keep missing from Django. SQLAlchemy feels really clunky by comparison
replies(2): >>44561669 #>>44562230 #
rollcat ◴[] No.44561669[source]
I think the ORM is fine. There's always some friction coming from mapping rows to classes and objects, but you can always drop down a layer and just pull raw tuples.

What I'm not a fan of, is the query DSL. Normally, the developer works to figure out how to express their problem with SQL; then the DB engine works to figure out how to map that SQL to the data it has on disk. Now Django adds another layer, which is completely unlike SQL, has its own unique pitfalls, etc; sometimes I find myself just dumping the raw SQL, working on that to get the result I wanted, then working that back to the DSL.

I think SQLAlchemy gets it right. The query language is a thin veil over SQL, and mapping to objects is an explicit and clear operation. What does feel clunky to me, is setup: SQLAlchemy expects you to bring your own glue; Django is vertically integrated.

replies(2): >>44570628 #>>44573777 #
1. vFunct ◴[] No.44570628[source]
This is my pain point in Django as well, the query DSL. 10+ years with Django and I still don't know how it's supposed to work, given it's all done within the namespace of a function call.

Fortunately, I now have AI to write any Django queries for me.