bornhack-website/news/models.py
2016-06-05 23:20:06 +02:00

23 lines
545 B
Python

from __future__ import unicode_literals
from django.db import models
from utils.models import CreatedUpdatedModel
from news.managers import NewsItemQuerySet
class NewsItem(CreatedUpdatedModel):
class Meta:
ordering = ['-published_at']
title = models.CharField(max_length=100)
content = models.TextField()
public = models.BooleanField(default=False)
published_at = models.DateTimeField()
slug = models.SlugField()
def __str__(self):
return self.title
objects = NewsItemQuerySet.as_manager()