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

# Create your models here.


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

    def __str__(self):
        return self.title

    class Meta:
        verbose_name = 'Ogłoszenie'
        verbose_name_plural = 'Ogłoszenia'
        ordering = ['-created_at']


class GrandPrixW(SingletonModel):
    content = HTMLField('Tekst GPW')

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

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