[Cubicweb] customize rendering of a specific attribute in cw
aurelien.campeas at gmail.com
Fri May 25 09:29:43 CEST 2012
On entity classes, there is a printable_value method that can also be
customized (on Airport in your case) .
This should be invoked (automatically) by the 'attribute' view (in
2012/5/25 Stéphane Bugat <stephane.bugat at free.fr>
> 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!
> Cubicweb mailing list
> Cubicweb at lists.cubicweb.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cubicweb