models.py 782 Bytes
Newer Older
cynddl's avatar
cynddl committed
1
from django.db import models
cynddl's avatar
cynddl committed
2
3
from django.utils.translation import ugettext_lazy as _
from taggit.managers import TaggableManager
cynddl's avatar
cynddl committed
4

cynddl's avatar
cynddl committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

class Article(models.Model):
    url = models.URLField("URL")
    lang = models.CharField(_("Language"), max_length=50)
    metadata = models.TextField(_("Opengraph metadata"))
    screenshot = models.ImageField(_("Article screenshot"))
    title = models.CharField(_("Article title"), max_length=255)
    extracts = models.TextField(_("Content extracts"))

    published_at = models.DateTimeField(_("Publication date"))
    created_at = models.DateTimeField(_("Creation date"), auto_now_add=True)
    updated_at = models.DateTimeField(_("Last update"), auto_now=True)
    published = models.BooleanField(_("Published"))

    tags = TaggableManager()