Přesun kódu modelů odevzdávátka
This commit is contained in:
parent
1af4a13a62
commit
9b3cbb512c
16 changed files with 16 additions and 17 deletions
|
@ -1,6 +1,6 @@
|
|||
from django.contrib import admin
|
||||
from django_reverse_admin import ReverseModelAdmin
|
||||
from seminar.models.odevzdavatko import *
|
||||
from .models import *
|
||||
|
||||
|
||||
class PrilohaReseniInline(admin.TabularInline):
|
||||
|
|
|
@ -7,7 +7,7 @@ from django.utils import timezone
|
|||
from personalni.models import Resitel
|
||||
from tvorba.models import Problem, Deadline
|
||||
from seminar.models.nastaveni import Nastaveni
|
||||
from seminar.models.odevzdavatko import *
|
||||
from .models import *
|
||||
|
||||
import logging
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import datetime
|
|||
from itertools import groupby
|
||||
import logging
|
||||
|
||||
from seminar.models.odevzdavatko import *
|
||||
from .models import *
|
||||
from tvorba.models import Problem, Rocnik, Deadline
|
||||
from seminar.models.nastaveni import Nastaveni
|
||||
from personalni.models import Resitel, Organizator, Osoba
|
||||
|
|
|
@ -252,7 +252,7 @@ class Resitel(SeminarModelBase):
|
|||
def vsechny_body(self):
|
||||
"Spočítá body odjakživa."
|
||||
vsechna_reseni = self.reseni_set.all()
|
||||
from seminar.models.odevzdavatko import Hodnoceni
|
||||
from odevzdavatko.models import Hodnoceni
|
||||
vsechna_hodnoceni = Hodnoceni.objects.filter(
|
||||
reseni__in=vsechna_reseni)
|
||||
return sum(h.body for h in list(vsechna_hodnoceni) if h.body is not None)
|
||||
|
@ -299,7 +299,7 @@ class Resitel(SeminarModelBase):
|
|||
# - body z 25. ročníku a dříve byly shledány dvakrát hodnotnějšími
|
||||
# - proto se započítávají dvojnásobně a byly posunuté hranice titulů
|
||||
# - staré tituly se ale nemají odebrat, pokud řešitel v t.č. minulém (26.) ročníku měl titul, má ho mít pořád.
|
||||
from seminar.models.odevzdavatko import Hodnoceni
|
||||
from odevzdavatko.models import Hodnoceni
|
||||
hodnoceni_do_25_rocniku = Hodnoceni.objects.filter(deadline_body__cislo__rocnik__rocnik__lte=25,reseni__in=self.reseni_set.all())
|
||||
novejsi_hodnoceni = Hodnoceni.objects.filter(reseni__in=self.reseni_set.all()).difference(hodnoceni_do_25_rocniku)
|
||||
|
||||
|
@ -337,7 +337,7 @@ class Resitel(SeminarModelBase):
|
|||
else:
|
||||
return Titul.akad
|
||||
|
||||
from seminar.models.odevzdavatko import Hodnoceni
|
||||
from odevzdavatko.models import Hodnoceni
|
||||
hodnoceni_do_26_rocniku = Hodnoceni.objects.filter(deadline_body__cislo__rocnik__rocnik__lte=26,reseni__in=self.reseni_set.all())
|
||||
novejsi_body = body_z_hodnoceni(
|
||||
Hodnoceni.objects.filter(reseni__in=self.reseni_set.all())
|
||||
|
|
|
@ -9,7 +9,7 @@ from django.contrib.auth.mixins import LoginRequiredMixin
|
|||
from django.db import transaction
|
||||
from django.http import HttpResponse
|
||||
|
||||
from seminar.models.odevzdavatko import Hodnoceni
|
||||
from odevzdavatko.models import Hodnoceni
|
||||
from .models import *
|
||||
from tvorba.models import Tema, Uloha, Clanek
|
||||
from seminar.models.nastaveni import Nastaveni
|
||||
|
|
|
@ -9,7 +9,7 @@ from django.conf import settings
|
|||
|
||||
from personalni.models import Skola, Resitel
|
||||
from tvorba.models import Rocnik, Cislo, Problem
|
||||
from seminar.models.odevzdavatko import Reseni
|
||||
from odevzdavatko.models import Reseni
|
||||
from seminar.testutils import create_test_data
|
||||
import django.contrib.auth
|
||||
User = django.contrib.auth.get_user_model()
|
||||
|
|
|
@ -2,7 +2,7 @@ from __future__ import unicode_literals
|
|||
|
||||
from django.db import models, migrations
|
||||
import django_countries.fields
|
||||
from seminar.models.odevzdavatko import generate_filename
|
||||
from odevzdavatko.models import generate_filename
|
||||
import django.utils.timezone
|
||||
from django.conf import settings
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import django.db.models.deletion
|
|||
import django.utils.timezone
|
||||
import django_countries.fields
|
||||
import imagekit.models.fields
|
||||
from seminar.models.odevzdavatko import generate_filename
|
||||
from odevzdavatko.models import generate_filename
|
||||
from seminar.models.soustredeni import generate_filename_konfera
|
||||
from tvorba.models import cislo_pdf_filename, cislo_png_filename
|
||||
import taggit.managers
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
from .odevzdavatko import *
|
||||
from .base import *
|
||||
from .soustredeni import *
|
||||
from .pomocne import *
|
||||
|
|
|
@ -8,7 +8,7 @@ from unidecode import unidecode # Používám pro získání ID odkazu (ještě
|
|||
|
||||
from polymorphic.models import PolymorphicModel
|
||||
|
||||
from .odevzdavatko import Reseni
|
||||
from odevzdavatko.models import Reseni
|
||||
from personalni.models import Organizator
|
||||
|
||||
from .pomocne import Text
|
||||
|
|
|
@ -15,7 +15,7 @@ from korektury.testutils import create_test_pdf
|
|||
from models.nastaveni import *
|
||||
from personalni.models import *
|
||||
from tvorba.models import *
|
||||
from seminar.models.odevzdavatko import *
|
||||
from odevzdavatko.models import *
|
||||
from seminar.models.soustredeni import *
|
||||
from seminar.models.novinky import *
|
||||
from seminar.models.pomocne import *
|
||||
|
|
|
@ -20,7 +20,7 @@ from personalni.models import Organizator, Resitel, Skola, Prijemce
|
|||
from tvorba.models import Clanek, Rocnik
|
||||
from seminar.models.treenode import CisloNode
|
||||
from seminar.models.soustredeni import Konfery_Ucastnici, Soustredeni_Ucastnici
|
||||
from seminar.models.odevzdavatko import Reseni_Resitele
|
||||
from odevzdavatko.models import Reseni_Resitele
|
||||
import treenode.treelib as t
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
@ -3,7 +3,7 @@ from rest_polymorphic.serializers import PolymorphicSerializer
|
|||
|
||||
from seminar.models.treenode import *
|
||||
from seminar.models.pomocne import Text
|
||||
from seminar.models.odevzdavatko import Reseni
|
||||
from odevzdavatko.models import Reseni
|
||||
from tvorba.models import Problem, Uloha
|
||||
from treenode import treelib
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ from django.core.exceptions import PermissionDenied
|
|||
from rest_framework.permissions import BasePermission, AllowAny
|
||||
from seminar.models.treenode import *
|
||||
from tvorba.models import Problem, Uloha
|
||||
from seminar.models.odevzdavatko import Reseni
|
||||
from odevzdavatko.models import Reseni
|
||||
import treenode.serializers as views
|
||||
|
||||
from treenode.permissions import AllowWrite
|
||||
|
|
|
@ -3,7 +3,7 @@ from functools import cached_property
|
|||
from typing import Union, Iterable # TODO: s pythonem 3.10 přepsat na '|'
|
||||
|
||||
from tvorba.models import Rocnik, Cislo, Deadline, Problem, Clanek
|
||||
from seminar.models.odevzdavatko import Hodnoceni
|
||||
from odevzdavatko.models import Hodnoceni
|
||||
from personalni.models import Resitel
|
||||
from seminar.models.soustredeni import Konfera
|
||||
from django.db.models import Q, Sum
|
||||
|
|
Loading…
Reference in a new issue