How to tango with Django - models
The snippet can be accessed without any authentication.
Authored by
Colin Wirz
Edited
models.py 388 B
from django.db import models
class Post(models.Model):
title = models.CharField(
verbose_name='title',
max_length=200,
)
content = models.TextField(
verbose_name='content',
blank=True,
null=True,
)
created = models.DateField(
verbose_name='created',
auto_now_add=True,
)
def __str__(self):
return self.title
Please register or sign in to comment