Subject: | Foreign key label in has_one relationships (label_column) |
When configuring has_one relationships in the form, one can currently
select the column which will be used as a label in the Select widget
(through the label_column attribute). This works fine when one single
column describes the element for the relationship (i.e. a column named
"NAME", "DESCRIPTION", or similar).
When the entity is a person, though, it would be great that not one
column but that the concatenation of several of them in some specific
way could be used as the label; i.e. use "NAME || ' ' || FAMILY_NAME" as
the label (SQL syntax).
In this way, one would be able to select from a selection widget which
has the complete name of the employee, and not only the first name.
This could be implemented, for example, by allowing label_column to be a
listref of columns which would be concatenated by default with a single
space in between. Maybe a new option would be more convenient so as to
not break compatibility.
I have tried to do it by myself, but the changes involved seemed to be
too intrusive initially. I'll explore new ways and attach a patch in
case I get it.
Thanks
Jorge