I have field titles which need to indicate "less than or equal" or "greater
than" symbols. HTML provides such escapes with the character sequences
≤ and > respectively. But when I use these characters in the "title"
of a Field, the displayed SQLFORM changes these back into "≤" for
example instead of displaying the "less than or equal" symbol. If I use
the Field titles directly in a table on my own, they work as expected.
Is there a reason why the "title" of a Field is afforded this extra
protection from me, the hapless programmer?
Here's a table definition, cuz Anthony always asks for one. (And he's
right to.)
db.define_table("event",
Field("id_meet", "reference meet", label=T("Meet")),
Field("id_session", "reference session", label=T("Session")),
Field("id_event", "reference event_index", label=T("Event")),
#Field("day", "integer", notnull=True, label=T("Day")),
Field("ord", "integer", notnull=True, label=T("Order")),
Field("swim_num", "string", notnull=True, label=T("Number")),
elapsed_time_field("lcm_gt",label=T("LCM >")),
elapsed_time_field("lcm_le",label=T("LCM ≤")),
elapsed_time_field("scm_gt",label=T("SCM >")),
elapsed_time_field("scm_le",label=T("SCM ≤")),
elapsed_time_field("scy_gt",label=T("SCY >")),
elapsed_time_field("scy_le",label=T("SCY ≤")),
Field("nt_ok", "boolean", label=T("Allow NT")),
format=event_list,
migrate=current.settings.migrate)
You will notice I'm using a Field factory "elapsed_time_field" to create
the Field objects. It just defines each as an integer field and presets
the validator and formatter. Before you ask.... Yes, I tried it with and
without the T() operator. There was no change on the SQLFORM and the table
still works as expected.
-- Joe
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.