In this video you will be creating your data model in Django . Let’s go over what that means before we get started. I’ll provide you with a very simple explanation.
Let’s say you need to create a scheduling app for a vet office. One of the tables in your relational database is Pet. Pet has the following fields, age, gender, type, weight and owner. Your app needs to create, read, update and delete data from the Pet table. Create, read, update and delete are known as the CRUD functions.
The purpose of a database is very similar to the purpose of the object oriented programming paradigm, in that we are digitally modeling objects and ideas we find in the physical world. While this translates to tables and records in relational databases,.. in object oriented programming languages this translates to objects, typically class definitions, as is the case with Python.
Therefore when we model our data, we are basically creating a class to match our database table structure. We make a class name to match the table’s name and then make the class attributes, or member variables, match the table’s field names and data types.
The combination of field names and their associated data types, such as integer for age, string for gender and type, float for weight, and string for owner, is commonly referred to as the schema.
bultita on May 9, 2019
Hi, There is error when I run the server - python manage.py runserver : “django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried “gdal203”, “gdal202”, “gdal201”, “gdal20”, “gdal111”). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.”
Appreciate your help.
Thanks, Assaye