formation_django/exemple/mon_site/blog/models.py
2018-04-07 15:49:12 +02:00

19 lines
430 B
Python

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
)