[Erp5-dev] date/time properites' constraint check

Jérome Perrin jerome at nexedi.com
Mon May 19 13:12:37 CEST 2008


Hello,

Le vendredi 16 mai 2008 à 12:28 +0200, Mikolaj Antoszkiewicz a écrit :
> 
> Mikolaj Antoszkiewicz wrote:
> > Hello,
> > 
> > When using PropertyExistence constraint class I noticed that when date 
> > properties fail the constraint check it always returns the 
> > 'message_no_such_property' type of message.
> > 
> > It looks like that, because hasProperty tester always returns False, if 
> > the date/time property is unset, just like it was non-existent property.
> 
> What I somehow missed in the last post is that all other properties 
> behave similarly.
> But for them the attached patch solves the problem (typo corrections 
> included)

For now, I'll commit those typos fixs, thanks.

> - instead of hasProperty, I propose using getProperty with additional 
> parameter.

According to Jean-Paul's message, the message associated with
hasProperty returning False here was wrong. As far as I know, there's no
easy way to know if a property is associated to this document or not,
but afterall does this constraint needs to make a difference wether the
property is not associated to this type (this would be the programmer's
mistake) or the property is not set by the user ?
What about changing this constraint to only check if the property has
been set by the user ?

Jérome




More information about the Erp5-dev mailing list