Hacker News Comments on
James Bennett - Django in Depth - PyCon 2015
PyCon 2015
·
Youtube
·
2
HN comments
- This course is unranked · view top recommended courses
Hacker News Stories and Comments
All the comments and stories posted to Hacker News that reference this video.And I used to think like that. As if I was giving up potential. So I went through this SQLAlchemy core phase (http://docs.sqlalchemy.org/en/latest/core/tutorial.html). Though, never back to writing raw SQL, but I did some of that back in 2002-2003. And despite being challenged by colleagues skeptical of ORM's, I've yet to see a shortcoming for using an ORM in web development frameworks in python.In fact I'm coming short on a value equation where it'd be more secure / efficient / readable without at least a query builder.
> but ORM means giving up a lot of control
What control is being lost, specifically?
> (and transparency, and understanding)
Highly recommend Django in Depth by James Bennett at PyCon 2015. https://www.youtube.com/watch?v=tkwZ1jG3XgA
Also, try out printing the .query of the QuerySet:
print(MyUser.objects.all().query)
SELECT "core_myuser"."id", "core_myuser"."password", "core_myuser"."last_login", "core_myuser"."is_superuser", "core_myuser"."username", "core_myuser"."email", "core_myuser"."is_active", "core_myuser"."is_admin" FROM "core_myuser"
And Q(), https://docs.djangoproject.com/en/1.11/topics/db/queries/#co..., .extra(), https://docs.djangoproject.com/en/1.11/ref/models/querysets/..., and finally raw SQL queries https://docs.djangoproject.com/en/1.11/topics/db/sql/.
> of your database in exchange for a few shortcuts regarding things like M:M links.
Maybe a few other benefits: helps with readability, consistent with OOP in python. Works across SQL dialects. Prevents mistakes, since those relationships are common. Getting clear and consistent access to common data retrieval and updating.
There are a lot of 3 hour sessions. I love these compared to the 20 minute talks, since they go deep into the topic. I just watched James Bennett's "Django in Depth" and it was excellent https://www.youtube.com/watch?v=tkwZ1jG3XgA