formation_django/exemple/mon_site/blog/models.py

20 lines
430 B
Python
Raw Permalink Normal View History

2018-04-07 13:49:12 +00:00
from django.db import models
class Article(models.Model):
"""Un article sur mon super site."""
text = models.TextField(verbose_name="Texte")
title = models.CharField(
max_length=255,
verbose_name="Titre"
)
date = models.DateField(
verbose_name="Date de parution"
)
def __str__(self):
return "'{}' : {}".format(
self.title,
self.date
)