Tsallaka zuwa abun ciki
Justice Tech School

Defining a Model

A model is a Python class for a table.

Example
from django.db import models

class Post(models.Model):
    title = models.CharField(max_length=100)
    body = models.TextField()
    created = models.DateTimeField(auto_now_add=True)

Exercise

Base class.

class Post(models.)

Quiz Test

What does a model map to?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.