[Cubicweb] customize rendering of a specific attribute in cw

Stéphane Bugat stephane.bugat at free.fr
Fri May 25 09:06:13 CEST 2012

Hi all,

I was wondering if there was a way to customize the rendering of a specific attribute of an entity.
For instance, I have an Airport entity with 2 Float(), latitude and longitude. These floats are usually displayed using the form xx°yy'zz'' (for instance 45.658333 ==> 45° 39' 30.00" N).
At present I have modified the Airport PrimaryView function render_attributes(), but this means I have to set up how all other attributes are rendered. Moreover I have to do this for all specific context views of the Airport object.
Another option would be to define a full Entity "Coordinate" and to put an inlined relation between Airport and Coordinate, but that would be a hammer to crush a fly.

Thanks for any help!


More information about the Cubicweb mailing list