[Erp5-dev] Relation String Field - using something other than title

Łukasz Nowak lukasz.nowak at ventis.com.pl
Thu Aug 9 10:31:03 CEST 2007


Hello,

On 2007-08-09, 10:18:22
Jérome Perrin <jerome at nexedi.com> wrote:
(...)
> > How my I gain such behaviour? Shall I patch ERP5Type/Utils.py
and
> > ERP5Type/Accessors/Value.py and create there getter/setter for
> > ShuProp?
> 
> Hello,
> 
> Yes, a way is to generate category accessors for getCategoryShuProp,
> but an easiest way is to use something like 'python: 
> context.getCategoryValue().getShuProp()' in the 'default' TALES of
> your relation field.

It was so simple...

> ( you can add a condition to handle the case where 
> context.getCategoryValue() is None )

You mean:

python: context.getCategoryValue() is not None and \
context.getCategoryValue().getShuProp() or ''
?

Is it enough "stable" to put this use case of RLS on wiki[1]?

Thanks,
Luke

[1]http://www.erp5.org/HowToConfigureRelationField

-- 
Łukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...''



More information about the Erp5-dev mailing list