from django.db import models
from tinymce.models import HTMLField
from admin_ordering.models import OrderableModel
from core.utils import SingletonModel

# Create your models here.


class Post(OrderableModel):
    title = models.CharField('Tytuł', default='', blank=True, max_length=250)
    content = HTMLField('Treść', default='', blank=True)
    created_at = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.title or '(brak tytułu)'

    class Meta(OrderableModel.Meta):
        verbose_name = 'Aktualność PodlZBS'
        verbose_name_plural = 'Aktualności PodlZBS'


class GrandPrixW(SingletonModel):
    content = HTMLField('Tekst GPW', default='', blank=True)

    def __str__(self):
        return 'Grand Prix Województwa'

    class Meta:
        verbose_name = 'Grand Prix Województwa'
        verbose_name_plural = 'Grand Prix Województwa'
