Efficient use of Django ORM
Hiren Patel (~hirenalken) |
Object-Relational Mapper (ORM) is one of the powerful feature of Django. It allows us to interact with database without writing long complex SQL queries.
The contents that will be covered in the discussion are as follows.
- Introduction to ORM, How it works ?
- What is queryset ? how it works ?
- Explaining use of values, values_list, only and defer to run ORM query efficiently
- How to use select_related and prefetch_related to optimize queries
- Some examples to show, how to query very complex data using only ORM
- What not to do while using ORM to avoid slow performance
- Basic knowledge of Python and Python web framework (Django)
- Some experience in quering relational databases
I will upload slides soon.
My name is Hiren Patel. I am working at Aubergine solutions pvt ltd and I have been doing full stack web development there from last 2.5 years. While working on some web projects, I have always focused on learning django in more detail and try to optimize APIs to return response faster.
- Github: https://github.com/hirenalken
- LinkedIn: https://www.linkedin.com/in/hiren-patel-046672ab/
- StackOverFlow: https://stackoverflow.com/users/3553279/hiren-patel?tab=profile
- Medium: https://medium.com/@hirenpatel_38103
I had presented a talk on this same topic in meetup organised by Ahmedabad based meetup group. here is the link to meetup: link