From af8da27fff2bb0610c95ea4636810657c696c0e5 Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Wed, 17 Feb 2016 16:17:47 +0100 Subject: [PATCH] Fixes in webmodel --- paramecio/citoplasma/templates/forms/i18nform.phtml | 4 ++-- paramecio/cromosoma/extrafields/i18nfield.py | 4 ++-- paramecio/cromosoma/extraforms/i18nform.py | 6 +++--- paramecio/cromosoma/webmodel.py | 3 --- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/paramecio/citoplasma/templates/forms/i18nform.phtml b/paramecio/citoplasma/templates/forms/i18nform.phtml index 0042263..c6506dd 100644 --- a/paramecio/citoplasma/templates/forms/i18nform.phtml +++ b/paramecio/citoplasma/templates/forms/i18nform.phtml @@ -1,6 +1,6 @@ ${add_js_home_local('tools.js', 'admin')}
-${form.show()} +${form.form()|n} <%def name="select_lang(i18n, lang_selected)"> % if i18n==lang_selected: choose_flag @@ -10,7 +10,7 @@ ${form.show()} % if lang_selected!=None: % for i18n in arr_i18n: - ${i18n} + ${name_form}_${i18n} % endfor % endif
\ No newline at end of file diff --git a/paramecio/cromosoma/extrafields/i18nfield.py b/paramecio/cromosoma/extrafields/i18nfield.py index 04022c3..ca44378 100644 --- a/paramecio/cromosoma/extrafields/i18nfield.py +++ b/paramecio/cromosoma/extrafields/i18nfield.py @@ -2,7 +2,7 @@ import json from paramecio.cromosoma.webmodel import PhangoField -from paramecio.cromosoma.coreforms import TextForm +from paramecio.cromosoma.coreforms import BaseForm from paramecio.cromosoma.extraforms.i18nform import I18nForm from paramecio.citoplasma.i18n import I18n from paramecio.citoplasma.httputils import GetPostFiles @@ -14,7 +14,7 @@ class I18nField(PhangoField): super().__init__(name) self.name_form=I18nForm - self.parameters=[TextForm(name, '')] + self.extra_parameters=[BaseForm(name, '')] def check(self, value): diff --git a/paramecio/cromosoma/extraforms/i18nform.py b/paramecio/cromosoma/extraforms/i18nform.py index 76e4c44..9e0f3e4 100644 --- a/paramecio/cromosoma/extraforms/i18nform.py +++ b/paramecio/cromosoma/extraforms/i18nform.py @@ -12,6 +12,6 @@ class I18nForm(BaseForm): self.form_child=form - def form(): - - return standard_t.load_template('forms/i18nform.phtml', form=self.form_child) \ No newline at end of file + def form(self): + print(self.name) + return standard_t.load_template('forms/i18nform.phtml', name_form=self.name, form=self.form_child, arr_i18n=I18n.dict_i18n, lang_selected=I18n.default_lang) \ No newline at end of file diff --git a/paramecio/cromosoma/webmodel.py b/paramecio/cromosoma/webmodel.py index 045c809..1fbbed4 100644 --- a/paramecio/cromosoma/webmodel.py +++ b/paramecio/cromosoma/webmodel.py @@ -854,9 +854,6 @@ class PhangoField: self.txt_error="" - # Array for create initial parameters for form.. - self.parameters=[] - # Themodel where this component or field live self.model=None