Automaticke doplnovani cisla reseni u uloh
This commit is contained in:
parent
d755295b74
commit
4bf299bf25
1 changed files with 6 additions and 6 deletions
|
@ -29,12 +29,6 @@ class SeminarModelBase(models.Model):
|
|||
def verejne(self):
|
||||
return False
|
||||
|
||||
# def public_url(self):
|
||||
# if self.Meta.url_name:
|
||||
# return reverse(self.Meta.url_name,
|
||||
# kwargs={'id': self.id, 'pk': self.id})
|
||||
# return None
|
||||
|
||||
def get_absolute_url(self):
|
||||
return self.verejne_url() # TODO "absolute"
|
||||
|
||||
|
@ -440,6 +434,12 @@ class Reseni(SeminarModelBase):
|
|||
return force_unicode(u"%s: %s (%sb)" % (self.resitel.plne_jmeno(), self.problem.nazev, self.body))
|
||||
# NOTE: Potenciální DB HOG (bez select_related)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if ((self.cislo_body is None) and (self.problem.cislo_reseni) and
|
||||
(self.problem.typ == Problem.TYP_ULOHA)):
|
||||
self.cislo_body = self.problem.cislo_reseni
|
||||
super(Reseni, self).save(*args, **kwargs)
|
||||
|
||||
|
||||
# PrilohaReseni method
|
||||
def generate_filename(self, filename):
|
||||
|
|
Loading…
Reference in a new issue