from django.db import models
from admin_ordering.models import OrderableModel
from tinymce.models import HTMLField
from filebrowser.fields import FileBrowseField

# Create your models here.


class Tournament(OrderableModel):
    photo = FileBrowseField(
        'Zdjęcie', directory='inneturnieje/', max_length=200, blank=True)
    title = models.CharField('Tytuł', max_length=250)
    content = HTMLField('Tekst')
    link = models.TextField('Link do wyników')

    def __str__(self):
        return self.title

    class Meta(OrderableModel.Meta):
        verbose_name = 'Inny turniej'
        verbose_name_plural = 'Inne turnieje'
