Browse Source

drobnosti do pythonu 3

export_seznamu_prednasek
Anet 5 years ago
parent
commit
ca89637c26
  1. 18
      seminar/autocomplete_light_registry.py

18
seminar/autocomplete_light_registry.py

@ -21,7 +21,7 @@ class SkolaAutocomplete(autocomplete_light.AutocompleteModelBase):
attrs = { attrs = {
# This will set the input placeholder attribute: # This will set the input placeholder attribute:
'placeholder': u'Škola', 'placeholder': 'Škola',
# This will set the yourlabs.Autocomplete.minimumCharacters # This will set the yourlabs.Autocomplete.minimumCharacters
# options, the naming conversion is handled by jQuery # options, the naming conversion is handled by jQuery
'data-autocomplete-minimum-characters': 1, 'data-autocomplete-minimum-characters': 1,
@ -46,11 +46,11 @@ class ResitelAutocomplete(autocomplete_light.AutocompleteModelBase):
limit_choices = 15 limit_choices = 15
def choice_label(self, resitel): def choice_label(self, resitel):
return u"%s, %s (%s)" % (resitel.plne_jmeno(), resitel.mesto, resitel.rok_maturity) return "%s, %s (%s)" % (resitel.plne_jmeno(), resitel.mesto, resitel.rok_maturity)
attrs= { attrs= {
# This will set the input placeholder attribute: # This will set the input placeholder attribute:
'placeholder': u'Řešitel', 'placeholder': 'Řešitel',
# This will set the yourlabs.Autocomplete.minimumCharacters # This will set the yourlabs.Autocomplete.minimumCharacters
# options, the naming conversion is handled by jQuery # options, the naming conversion is handled by jQuery
'data-autocomplete-minimum-characters': 1, 'data-autocomplete-minimum-characters': 1,
@ -75,13 +75,13 @@ class OrganizatorAutocomplete(autocomplete_light.AutocompleteModelBase):
limit_choices = 15 limit_choices = 15
def choice_label(self, organizator): def choice_label(self, organizator):
return u"%s '%s' %s" % (organizator.user.first_name, return "%s '%s' %s" % (organizator.user.first_name,
organizator.prezdivka, organizator.prezdivka,
organizator.user.last_name) organizator.user.last_name)
attrs = { attrs = {
# This will set the input placeholder attribute: # This will set the input placeholder attribute:
'placeholder': u'Organizátor', 'placeholder': 'Organizátor',
# This will set the yourlabs.Autocomplete.minimumCharacters # This will set the yourlabs.Autocomplete.minimumCharacters
# options, the naming conversion is handled by jQuery # options, the naming conversion is handled by jQuery
'data-autocomplete-minimum-characters': 1, 'data-autocomplete-minimum-characters': 1,
@ -111,17 +111,17 @@ class ProblemAutocomplete(autocomplete_light.AutocompleteModelBase):
if p.stav == Problem.STAV_ZADANY: if p.stav == Problem.STAV_ZADANY:
popisek = "" popisek = ""
try: try:
popisek = u"%s (%s, %s.%s)" % (p.nazev, p.typ, p.cislo_zadani.rocnik.rocnik, p.kod_v_rocniku()) popisek = "%s (%s, %s.%s)".format(p.nazev, p.typ, p.cislo_zadani.rocnik.rocnik, p.kod_v_rocniku())
except: except:
#popisek = u"%s (%s, %s.%s)" % (p.nazev, p.typ, p.stav) #popisek = "%s (%s, %s.%s)".format(p.nazev, p.typ, p.stav)
popisek = "CHYBA" popisek = "CHYBA"
return popisek return popisek
else: else:
return u"%s (%s, %s)" % (p.nazev, p.typ, p.stav) return "%s (%s, %s)".format(p.nazev, p.typ, p.stav)
attrs = { attrs = {
# This will set the input placeholder attribute: # This will set the input placeholder attribute:
'placeholder': u'Problém', 'placeholder': 'Problém',
# This will set the yourlabs.Autocomplete.minimumCharacters # This will set the yourlabs.Autocomplete.minimumCharacters
# options, the naming conversion is handled by jQuery # options, the naming conversion is handled by jQuery
'data-autocomplete-minimum-characters': 1, 'data-autocomplete-minimum-characters': 1,

Loading…
Cancel
Save