Usměrnění importů import *

This commit is contained in:
Jonas Havelka 2023-08-10 19:32:48 +02:00
parent 0c45d8051f
commit 1790c0faf7
13 changed files with 34 additions and 1 deletions

View file

@ -13,6 +13,8 @@ from tvorba.models import Cislo, Deadline, Problem, Uloha, aux_generate_filename
from personalni.models import Resitel from personalni.models import Resitel
from seminar.models.base import SeminarModelBase from seminar.models.base import SeminarModelBase
__all__ = ["Reseni", "Hodnoceni", "PrilohaReseni", "Reseni_Resitele"]
@reversion.register(ignore_duplicates=True) @reversion.register(ignore_duplicates=True)
class Reseni(SeminarModelBase): class Reseni(SeminarModelBase):

View file

@ -13,6 +13,8 @@ from reversion import revisions as reversion
from seminar.models.base import SeminarModelBase from seminar.models.base import SeminarModelBase
__all__ = ["Osoba", "Skola", "Prijemce", "Organizator", "Resitel"]
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

View file

@ -1,6 +1,7 @@
from django.urls import reverse from django.urls import reverse
from django.db import models from django.db import models
__all__ = ["SeminarModelBase"]
class SeminarModelBase(models.Model): class SeminarModelBase(models.Model):

View file

@ -5,6 +5,8 @@ from solo.models import SingletonModel
from tvorba.models import Cislo from tvorba.models import Cislo
__all__ = ["Nastaveni"]
@reversion.register(ignore_duplicates=True) @reversion.register(ignore_duplicates=True)
class Nastaveni(SingletonModel): class Nastaveni(SingletonModel):

View file

@ -6,6 +6,8 @@ from reversion import revisions as reversion
from personalni.models import Organizator from personalni.models import Organizator
__all__ = ["Novinky"]
@reversion.register(ignore_duplicates=True) @reversion.register(ignore_duplicates=True)
class Novinky(models.Model): class Novinky(models.Model):

View file

@ -6,6 +6,8 @@ from .base import SeminarModelBase
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
__all__ = ["Text", "Obrazek"]
class Text(SeminarModelBase): class Text(SeminarModelBase):
class Meta: class Meta:

View file

@ -14,6 +14,11 @@ from tvorba.models import Rocnik, Problem, aux_generate_filename
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
__all__ = [
"Soustredeni", "Soustredeni_Organizatori", "Soustredeni_Ucastnici",
"Konfera", "Konfery_Ucastnici"
]
@reversion.register(ignore_duplicates=True) @reversion.register(ignore_duplicates=True)
class Soustredeni(SeminarModelBase): class Soustredeni(SeminarModelBase):

View file

@ -3,6 +3,7 @@ import datetime
import lorem import lorem
from .models import * from .models import *
from tvorba.models import Rocnik
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

View file

@ -13,9 +13,16 @@ from personalni.models import Organizator
from seminar.models.pomocne import Text from seminar.models.pomocne import Text
from tvorba.models import Rocnik, Cislo, Tema, Uloha, Pohadka
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
from tvorba.models import Rocnik, Cislo, Tema, Uloha, Pohadka __all__ = [
"ReseniNode", "CastNode", "TextNode", "CisloNode", "PohadkaNode",
"OrgTextNode", "MezicisloNode", "TreeNode", "RocnikNode", "UlohaVzorakNode",
"UlohaZadaniNode", "TemaVCisleNode",
]
class TreeNode(PolymorphicModel): class TreeNode(PolymorphicModel):
class Meta: class Meta:

View file

@ -6,6 +6,7 @@ from rest_framework.permissions import BasePermission, AllowAny
from .models import * from .models import *
from tvorba.models import Problem, Uloha from tvorba.models import Problem, Uloha
from odevzdavatko.models import Reseni from odevzdavatko.models import Reseni
from seminar.models.pomocne import Text
import treenode.serializers as views import treenode.serializers as views
from treenode.permissions import AllowWrite from treenode.permissions import AllowWrite

View file

@ -1,5 +1,6 @@
# Todo: reversion # Todo: reversion
from django.core.exceptions import ValidationError
from django.contrib import admin from django.contrib import admin
from django.forms import ModelForm from django.forms import ModelForm
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe

View file

@ -39,6 +39,11 @@ from various.utils import roman
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
__all__ = [
"Rocnik", "Cislo", "Deadline", "Problem", "Uloha", "Tema", "Clanek",
"ZmrazenaVysledkovka", "Pohadka",
]
class OverwriteStorage(FileSystemStorage): class OverwriteStorage(FileSystemStorage):
""" Varianta FileSystemStorage, která v případě, že soubor cílového """ Varianta FileSystemStorage, která v případě, že soubor cílového
jména již existuje, ho smaže a místo něj uloží soubor nový""" jména již existuje, ho smaže a místo něj uloží soubor nový"""

View file

@ -1,3 +1,5 @@
__all__ = ["group_by_rocnik"]
def group_by_rocnik(clanky): def group_by_rocnik(clanky):
""" Vezme zadaný seznam článků a seskupí je podle ročníku. """ Vezme zadaný seznam článků a seskupí je podle ročníku.