2016-05-30 19:36:14 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from django.db import models
|
|
|
|
|
2016-05-30 19:51:17 +00:00
|
|
|
from utils.models import CreatedUpdatedModel
|
2016-05-30 19:36:14 +00:00
|
|
|
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()
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.title
|
|
|
|
|
|
|
|
objects = NewsItemQuerySet.as_manager()
|