Browse Source

Usměrnění importů `import *`

v3
Jonas Havelka 1 year ago
parent
commit
1790c0faf7
  1. 2
      odevzdavatko/models.py
  2. 2
      personalni/models.py
  3. 1
      seminar/models/base.py
  4. 2
      seminar/models/nastaveni.py
  5. 2
      seminar/models/novinky.py
  6. 2
      seminar/models/pomocne.py
  7. 5
      soustredeni/models.py
  8. 1
      soustredeni/testutils.py
  9. 9
      treenode/models.py
  10. 1
      treenode/viewsets.py
  11. 1
      tvorba/admin.py
  12. 5
      tvorba/models.py
  13. 2
      tvorba/utils.py

2
odevzdavatko/models.py

@ -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):

2
personalni/models.py

@ -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__)

1
seminar/models/base.py

@ -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):

2
seminar/models/nastaveni.py

@ -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):

2
seminar/models/novinky.py

@ -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):

2
seminar/models/pomocne.py

@ -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:

5
soustredeni/models.py

@ -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):

1
soustredeni/testutils.py

@ -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__)

9
treenode/models.py

@ -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:

1
treenode/viewsets.py

@ -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

1
tvorba/admin.py

@ -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

5
tvorba/models.py

@ -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ý"""

2
tvorba/utils.py

@ -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.

Loading…
Cancel
Save