You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"age_groups" is a list of Objects with attributes 'name' and 'checked'
Note that python variable "ag.name" appears in 4 places in the template, and the ag.checked variable once.
There are four entries in the "age_groups" list, "(Preschool, ' '), ('Child', ' '), ('Teen', ' ') and ('Adult', 'checked').
On Chrome (I have not tried on other browsers), I get this, where sometimes ${ag.name} is properly translated, and sometimes not (just left as "${ag.name}"
I don't think you can have ${ag.checked} just like that, standalone. It should be checked="${ag.checked}".
If you run your app using CHAMELEON_CACHE=./some-dir and perhaps CHAMELEON_DEBUG=1 then you can figure out what's going on in the generated Python code.
Thanks for your quick reply.
The "checked" specification is correct as is, from my reading of the HTML documentation. It is a "Boolean Attribute", which I think means the presence of the worded 'checked' is taken to mean true (and it seems to work).
I'm on windows; I tried setting the CHAMLEON_CACHE environment variable to "C:\temp" following your suggestion. This results in an exception on the second time a template is used (which is where the original problem showed up):
File "C:\Users\JonDe\PycharmProjects\TabDataTableTest\fairOps\Lib\site-packages\chameleon\loader.py", line 212, in build
os.rename(fn, name)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'c:\temp\_layout_6d06839ce8755075f5f936d55286068cd2dvtxur.tmp' -> 'c:\temp\_layout_6d06839ce8755075f5f936d55286068c.py'
Source: ... iv metal:use-macro="load: ../shared/_layout.html">
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
My main HTML template is "../shared/_layout.html", which has a slot for the template "entry_form.pt".
So it appears that the debug code is using the name of the shared_layout.html a second time (but that's just a wild guess on my part)
I have this code in a template:
"age_groups" is a list of Objects with attributes 'name' and 'checked'
Note that python variable "ag.name" appears in 4 places in the template, and the ag.checked variable once.
There are four entries in the "age_groups" list, "(Preschool, ' '), ('Child', ' '), ('Teen', ' ') and ('Adult', 'checked').
On Chrome (I have not tried on other browsers), I get this, where sometimes ${ag.name} is properly translated, and sometimes not (just left as "${ag.name}"
| Age Group: | | | Preschool | | | | Child | | | | Teen | | | | Adult | | |I've tried several work-arounds, but nothing seems to get the proper translation. Is there something I'm missing?
The text was updated successfully, but these errors were encountered: