In this lesson, you’re going to start looking at databases and Django models. When you created your app before, you created a file called models.py
. The models are where you do the database interactions.
This is what a Django model looks like:
# Create your models here.
class Project(models.Model):
title = models.CharField(max_length=100)
description = models.TextField()
technology = models.CharField(max_length=20)
image = models.FilePathField(path='/img/')
Pygator on Oct. 13, 2019
I get what you’re saying about the ORM, but how can you have a class defined without any mention of “self” . Really interesting !