This repository contains the code for a Django project that covers various topics related to Django ORM (Object-Relational Mapping) from basic to advanced concepts. Django ORM is a powerful feature of the Django framework that allows developers to interact with databases using Python objects.
This Django project serves as a comprehensive tutorial for learning Django ORM. It covers a wide range of topics starting from basic CRUD operations to more advanced concepts such as model relationships, queryset optimization, transactions, and more with SQLite3 and PostgreSQL.
- Basic CRUD operations with Django models
- Model relationships (OneToOne, ForeignKey, ManyToMany)
- Queryset operations (filtering, ordering, aggregations)
- Advanced queryset operations (annotate, prefetch_related, select_related)
- Transactions and atomicity
- Subquery, OuterRef and Exit
- select_for_update() function
- Django ContentType framework
- GenericForeingKey
- Database constraints, unique constraints & check constraints
- and more...
-
Clone the repository to your local machine:
$ git clone https://github.com/ZaidArman/ORM_Series.git
-
Install the dependencies using pip:
$ pip install -r requirements.txt
- Navigate to the project directory:
$ cd orm_series
- Activate Virual Enviroment:
$ orm_venv\scripts\activate
- Run the Django development server:
$ python manage.py runserver
-
Access the application in your web browser at
The tutorial covers the following topics:
- Basic CRUD operations with Django models
- Model relationships (OneToOne, ForeignKey, ManyToMany)
- Queryset operations (filtering, ordering, aggregations)
- Advanced queryset operations (annotate, prefetch_related, select_related)
- Transactions and atomicity
- Subquery, OuterRef and Exit
- select_for_update() function
- Django ContentType framework
- GenericForeingKey
- Database constraints, unique constraints & check constraints
- and more...
Each topic is accompanied by example code and explanations to help you understand the concepts thoroughly.
Contributions to this project are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.
Made with โค๏ธ by @ZaidArman ๐ Get in touch