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
My script generates a web form.
I would like to customize the rendering of the elements in the dropdown menu for an ObjectVar, displaying addtional information.
The description context variable allows to use an attribute as a description.
The model FrontPort has an attribute cable, which I'd like to use.
However, this attribute is not a String, but an object (Cable), and apparently the current implementation doesn't use its __str__() method, as it just displays object Object under the frontport name.
I have tried using cable__label and cable.label, but it didn't work.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
My script generates a web form.
I would like to customize the rendering of the elements in the dropdown menu for an
ObjectVar
, displaying addtional information.The
description
context variable allows to use an attribute as a description.The model
FrontPort
has an attributecable
, which I'd like to use.However, this attribute is not a String, but an object (Cable), and apparently the current implementation doesn't use its
__str__()
method, as it just displaysobject Object
under the frontport name.I have tried using
cable__label
andcable.label
, but it didn't work.How can I achieve this?
Beta Was this translation helpful? Give feedback.
All reactions