|
@ -13,21 +13,21 @@ class SkolaAutocomplete(autocomplete_light.AutocompleteModelBase): |
|
|
|
|
|
|
|
|
model = Skola |
|
|
model = Skola |
|
|
|
|
|
|
|
|
search_fields=['nazev', 'mesto', 'ulice'] |
|
|
search_fields = ['nazev', 'mesto', 'ulice'] |
|
|
|
|
|
|
|
|
split_words = True |
|
|
split_words = True |
|
|
|
|
|
|
|
|
limit_choices = 15 |
|
|
limit_choices = 15 |
|
|
|
|
|
|
|
|
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, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
widget_attrs={ |
|
|
widget_attrs = { |
|
|
'data-widget-maximum-values': 15, |
|
|
'data-widget-maximum-values': 15, |
|
|
'class': 'modern-style', |
|
|
'class': 'modern-style', |
|
|
} |
|
|
} |
|
@ -39,24 +39,24 @@ class ResitelAutocomplete(autocomplete_light.AutocompleteModelBase): |
|
|
|
|
|
|
|
|
model = Resitel |
|
|
model = Resitel |
|
|
|
|
|
|
|
|
search_fields=['jmeno', 'prijmeni'] |
|
|
search_fields = ['jmeno', 'prijmeni'] |
|
|
|
|
|
|
|
|
split_words = False |
|
|
split_words = False |
|
|
|
|
|
|
|
|
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, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
widget_attrs={ |
|
|
widget_attrs = { |
|
|
'data-widget-maximum-values': 15, |
|
|
'data-widget-maximum-values': 15, |
|
|
# Enable modern-style widget ! |
|
|
# Enable modern-style widget ! |
|
|
'class': 'modern-style', |
|
|
'class': 'modern-style', |
|
@ -68,26 +68,26 @@ class OrganizatorAutocomplete(autocomplete_light.AutocompleteModelBase): |
|
|
|
|
|
|
|
|
model = Organizator |
|
|
model = Organizator |
|
|
|
|
|
|
|
|
search_fields=['user__first_name', 'user__last_name', 'prezdivka'] |
|
|
search_fields = ['user__first_name', 'user__last_name', 'prezdivka'] |
|
|
|
|
|
|
|
|
split_words = False |
|
|
split_words = False |
|
|
|
|
|
|
|
|
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, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
widget_attrs={ |
|
|
widget_attrs = { |
|
|
'data-widget-maximum-values': 15, |
|
|
'data-widget-maximum-values': 15, |
|
|
# Enable modern-style widget ! |
|
|
# Enable modern-style widget ! |
|
|
'class': 'modern-style', |
|
|
'class': 'modern-style', |
|
@ -101,7 +101,7 @@ class ProblemAutocomplete(autocomplete_light.AutocompleteModelBase): |
|
|
|
|
|
|
|
|
model = Problem |
|
|
model = Problem |
|
|
|
|
|
|
|
|
search_fields=['nazev'] |
|
|
search_fields = ['nazev'] |
|
|
|
|
|
|
|
|
split_words = False |
|
|
split_words = False |
|
|
|
|
|
|
|
@ -111,23 +111,23 @@ 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, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
widget_attrs={ |
|
|
widget_attrs = { |
|
|
'data-widget-maximum-values': 10, |
|
|
'data-widget-maximum-values': 10, |
|
|
# Enable modern-style widget ! |
|
|
# Enable modern-style widget ! |
|
|
'class': 'modern-style', |
|
|
'class': 'modern-style', |
|
|