Django Models - Python Web Development

Опубликовано: 12 Июль 2021
на канале: codevev
399
14

#Python #Shorts

If you're familiar with SQL databases, then you may know that typically you need to use SQL statements to select, update, delete or insert the data into the database.

Django makes it easier and allows us using Python code to do all of it through what's known as ORM - object-relational mapping.

Whenever we created a new Django app, a new models.py file was generated inside it. This is where you can define your database models, or in the other words, the schema of the database.

All you need to do is create a new class or classes, which will represent the tables in SQL, make them inherit from models.Model, which comes from django.db, and define the fields, which will represent the columns in your table.

For all possible field types, please refer to the Django documentation: https://docs.djangoproject.com/en/3.2...

And in the next post we're going to see how to apply these models to the actual database, so make sure to subscribe to not miss out!
-------------------------------------------------------------------------------------
Links:
Blog: https://evgenyurubkov.com
Twitter:   / evgenyurubkov  
Instagram:   / evgenyurubkov  
Youtube:    / @codevev  


Смотрите видео Django Models - Python Web Development онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь codevev 12 Июль 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 399 раз и оно понравилось 14 людям.