do not use type codes in search form
This commit is contained in:
parent
f0535422bf
commit
cb738dfbab
|
@ -27,6 +27,7 @@ from plone.registry.interfaces import IRegistry
|
|||
|
||||
from tabellio.config.interfaces import ITabellioSettings
|
||||
import tabellio.config.utils
|
||||
from tabellio.documents.typenames import MAPPING
|
||||
|
||||
|
||||
class ListAuthorsView(BrowserView):
|
||||
|
@ -157,7 +158,8 @@ def possible_document_types(context):
|
|||
if not doctype:
|
||||
continue
|
||||
doctype_id = doctype.encode('ascii', 'replace')
|
||||
terms.append(SimpleVocabulary.createTerm(doctype_id, doctype_id, doctype))
|
||||
doctype_str = MAPPING.get(doctype, doctype)
|
||||
terms.append(SimpleVocabulary.createTerm(doctype_id, doctype_id, doctype_str))
|
||||
return SimpleVocabulary(terms)
|
||||
|
||||
@grok.provider(IContextSourceBinder)
|
||||
|
@ -169,7 +171,8 @@ def possible_dossier_types(context):
|
|||
if not dostype:
|
||||
continue
|
||||
dostype_id = dostype.encode('ascii', 'replace')
|
||||
terms.append(SimpleVocabulary.createTerm(dostype_id, dostype_id, dostype))
|
||||
dostype_str = MAPPING.get(dostype, dostype)
|
||||
terms.append(SimpleVocabulary.createTerm(dostype_id, dostype_id, dostype_str))
|
||||
return SimpleVocabulary(terms)
|
||||
|
||||
@grok.provider(IContextSourceBinder)
|
||||
|
@ -181,7 +184,8 @@ def possible_question_types(context):
|
|||
if not questype:
|
||||
continue
|
||||
questype_id = questype.encode('ascii', 'replace')
|
||||
terms.append(SimpleVocabulary.createTerm(questype_id, questype_id, questype))
|
||||
questype_str = MAPPING.get(questype, questype)
|
||||
terms.append(SimpleVocabulary.createTerm(questype_id, questype_id, questype_str))
|
||||
return SimpleVocabulary(terms)
|
||||
|
||||
@grok.provider(IContextSourceBinder)
|
||||
|
|
Reference in New Issue