From 1790c0faf7c06734347352091a92d97bc743fad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Thu, 10 Aug 2023 19:32:48 +0200 Subject: [PATCH] =?UTF-8?q?Usm=C4=9Brn=C4=9Bn=C3=AD=20import=C5=AF=20`impo?= =?UTF-8?q?rt=20*`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- odevzdavatko/models.py | 2 ++ personalni/models.py | 2 ++ seminar/models/base.py | 1 + seminar/models/nastaveni.py | 2 ++ seminar/models/novinky.py | 2 ++ seminar/models/pomocne.py | 2 ++ soustredeni/models.py | 5 +++++ soustredeni/testutils.py | 1 + treenode/models.py | 9 ++++++++- treenode/viewsets.py | 1 + tvorba/admin.py | 1 + tvorba/models.py | 5 +++++ tvorba/utils.py | 2 ++ 13 files changed, 34 insertions(+), 1 deletion(-) diff --git a/odevzdavatko/models.py b/odevzdavatko/models.py index 67903d2a..ae9bf5eb 100644 --- a/odevzdavatko/models.py +++ b/odevzdavatko/models.py @@ -13,6 +13,8 @@ from tvorba.models import Cislo, Deadline, Problem, Uloha, aux_generate_filename from personalni.models import Resitel from seminar.models.base import SeminarModelBase +__all__ = ["Reseni", "Hodnoceni", "PrilohaReseni", "Reseni_Resitele"] + @reversion.register(ignore_duplicates=True) class Reseni(SeminarModelBase): diff --git a/personalni/models.py b/personalni/models.py index 54088fec..177f3b27 100644 --- a/personalni/models.py +++ b/personalni/models.py @@ -13,6 +13,8 @@ from reversion import revisions as reversion from seminar.models.base import SeminarModelBase +__all__ = ["Osoba", "Skola", "Prijemce", "Organizator", "Resitel"] + logger = logging.getLogger(__name__) diff --git a/seminar/models/base.py b/seminar/models/base.py index 48226973..ecd1f6a6 100644 --- a/seminar/models/base.py +++ b/seminar/models/base.py @@ -1,6 +1,7 @@ from django.urls import reverse from django.db import models +__all__ = ["SeminarModelBase"] class SeminarModelBase(models.Model): diff --git a/seminar/models/nastaveni.py b/seminar/models/nastaveni.py index 46227b05..289c3040 100644 --- a/seminar/models/nastaveni.py +++ b/seminar/models/nastaveni.py @@ -5,6 +5,8 @@ from solo.models import SingletonModel from tvorba.models import Cislo +__all__ = ["Nastaveni"] + @reversion.register(ignore_duplicates=True) class Nastaveni(SingletonModel): diff --git a/seminar/models/novinky.py b/seminar/models/novinky.py index 7a3950de..a4591d6c 100644 --- a/seminar/models/novinky.py +++ b/seminar/models/novinky.py @@ -6,6 +6,8 @@ from reversion import revisions as reversion from personalni.models import Organizator +__all__ = ["Novinky"] + @reversion.register(ignore_duplicates=True) class Novinky(models.Model): diff --git a/seminar/models/pomocne.py b/seminar/models/pomocne.py index c9ef3268..091b6bc0 100644 --- a/seminar/models/pomocne.py +++ b/seminar/models/pomocne.py @@ -6,6 +6,8 @@ from .base import SeminarModelBase logger = logging.getLogger(__name__) +__all__ = ["Text", "Obrazek"] + class Text(SeminarModelBase): class Meta: diff --git a/soustredeni/models.py b/soustredeni/models.py index d05d8fbe..79845676 100644 --- a/soustredeni/models.py +++ b/soustredeni/models.py @@ -14,6 +14,11 @@ from tvorba.models import Rocnik, Problem, aux_generate_filename logger = logging.getLogger(__name__) +__all__ = [ + "Soustredeni", "Soustredeni_Organizatori", "Soustredeni_Ucastnici", + "Konfera", "Konfery_Ucastnici" +] + @reversion.register(ignore_duplicates=True) class Soustredeni(SeminarModelBase): diff --git a/soustredeni/testutils.py b/soustredeni/testutils.py index b950dbbb..bde1e75b 100644 --- a/soustredeni/testutils.py +++ b/soustredeni/testutils.py @@ -3,6 +3,7 @@ import datetime import lorem from .models import * +from tvorba.models import Rocnik logger = logging.getLogger(__name__) diff --git a/treenode/models.py b/treenode/models.py index 7f68492e..d6181f30 100644 --- a/treenode/models.py +++ b/treenode/models.py @@ -13,9 +13,16 @@ from personalni.models import Organizator from seminar.models.pomocne import Text +from tvorba.models import Rocnik, Cislo, Tema, Uloha, Pohadka + 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 Meta: diff --git a/treenode/viewsets.py b/treenode/viewsets.py index 62d7bbd5..7587634f 100644 --- a/treenode/viewsets.py +++ b/treenode/viewsets.py @@ -6,6 +6,7 @@ from rest_framework.permissions import BasePermission, AllowAny from .models import * from tvorba.models import Problem, Uloha from odevzdavatko.models import Reseni +from seminar.models.pomocne import Text import treenode.serializers as views from treenode.permissions import AllowWrite diff --git a/tvorba/admin.py b/tvorba/admin.py index 4137bbe5..ddf4738b 100644 --- a/tvorba/admin.py +++ b/tvorba/admin.py @@ -1,5 +1,6 @@ # Todo: reversion +from django.core.exceptions import ValidationError from django.contrib import admin from django.forms import ModelForm from django.utils.safestring import mark_safe diff --git a/tvorba/models.py b/tvorba/models.py index cd52e2b2..2a5cec7f 100644 --- a/tvorba/models.py +++ b/tvorba/models.py @@ -39,6 +39,11 @@ from various.utils import roman logger = logging.getLogger(__name__) +__all__ = [ + "Rocnik", "Cislo", "Deadline", "Problem", "Uloha", "Tema", "Clanek", + "ZmrazenaVysledkovka", "Pohadka", +] + class OverwriteStorage(FileSystemStorage): """ 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ý""" diff --git a/tvorba/utils.py b/tvorba/utils.py index 37d28577..8b0912e5 100644 --- a/tvorba/utils.py +++ b/tvorba/utils.py @@ -1,3 +1,5 @@ +__all__ = ["group_by_rocnik"] + def group_by_rocnik(clanky): """ Vezme zadaný seznam článků a seskupí je podle ročníku.