from django.db import models

# Create your models here.


class League(models.Model):
    rank = '_'
    year = models.IntegerField('Rok', primary_key=True)
    link = models.CharField('Link do wyników', max_length=512)

    def __str__(self):
        return f'{self.rank} Liga {self.year}'

    class Meta:
        abstract = True


class FirstLeague(League):
    rank = 'I'

    class Meta:
        verbose_name = 'Wyniki I ligi'
        verbose_name_plural = 'Wyniki I ligi'
        ordering = ['-year']


class SecondLeague(League):
    rank = 'II'

    class Meta:
        verbose_name = 'Wyniki II ligi'
        verbose_name_plural = 'Wyniki II ligi'
        ordering = ['-year']


class ThirdLeague(League):
    rank = 'III'

    class Meta:
        verbose_name = 'Wyniki III ligi'
        verbose_name_plural = 'Wyniki III ligi'
        ordering = ['-year']
