From 319a7b0cb93fa7e45201b1c6f38f4cbef53d8300 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Tue, 10 Jul 2012 17:27:39 +0200 Subject: [PATCH 1/4] report field: use getValue() as default for getSelectValue() --- expert/field.py | 2 +- expert/report.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/expert/field.py b/expert/field.py index 502f34a..2295771 100644 --- a/expert/field.py +++ b/expert/field.py @@ -36,7 +36,7 @@ from loops import util class Field(BaseField): def getSelectValue(self, row): - return self.getRawValue(row) + return self.getValue(row) class TextField(Field): diff --git a/expert/report.py b/expert/report.py index 2255ce9..c213a33 100644 --- a/expert/report.py +++ b/expert/report.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2011 Helmut Merz helmutm@cy55.de +# Copyright (c) 2012 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by From 62077c5dfbf598de1f3d170bcb3a9977a3209418 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Fri, 13 Jul 2012 10:43:11 +0200 Subject: [PATCH 2/4] use first type token as default type token, thus showing the correct fields in the create form --- browser/form.py | 2 ++ browser/form_macros.pt | 14 +++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/browser/form.py b/browser/form.py index aa59167..9e0ac7f 100644 --- a/browser/form.py +++ b/browser/form.py @@ -396,6 +396,8 @@ class CreateConceptForm(CreateObjectForm): parentType.getChildren([subtypePred])) types = [dict(token=ConceptTypeInfo(t).token, title=t.title) for t in tconcepts] + if self.defaultTypeToken is None and types: + self.defaultTypeToken = types[0]['token'] if include or include is None: return util.KeywordVocabulary(types + self.listTypes(include, ('hidden',))) return util.KeywordVocabulary(types) diff --git a/browser/form_macros.pt b/browser/form_macros.pt index 47f56b1..0ab2fe2 100644 --- a/browser/form_macros.pt +++ b/browser/form_macros.pt @@ -78,7 +78,10 @@ id="dialog_form" class="dialog" dojoType="dijit.form.Form" tal:define="qualifier request/qualifier|view/qualifier|string:resource; - innerForm request/inner_form|view/inner_form|string:inner_form.html; + innerForm + request/inner_form|view/inner_form|string:inner_form.html; + typesVocabulary python: + view.getTypesVocabulary((qualifier,)); typeToken view/typeToken; fixedType view/fixedType; langInfo view/languageInfo; @@ -104,8 +107,7 @@ '${view/virtualTargetUrl}/$innerForm')">