[Erp5-dev] Property default on string and StringField behavoiur

Łukasz Nowak lukasz.nowak at ventis.com.pl
Wed Jun 20 11:23:13 CEST 2007


Hello,

I created PropertySheet as attached. Associated it with Organisation
portal type.

Created new organisation, invoked scripts:
print repr(context.getVentis())
print repr(context.getProperty('ventis'))

shows:
''
''

Now added StringField my_ventis to Organisation_view. Put data in it
'some data', above script returns:
'data'
'data'

Removed string from widget, updated form, now above script returns:
None
None

I was comparing objects with them default value ('') all the time and
workaround it with comparing to '' and None. But I thought, that after
reseting value it will become default from PropertySheet and not None...

Is it my error, bug or feature? Is it documented anywhere?

Luke

-- 
Ł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...''

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ventis.py
Type: text/x-python
Size: 252 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20070620/4692e707/attachment.py>


More information about the Erp5-dev mailing list