logo       

mutator not called on empty value?: msg#00090

web.zope.plone.archetypes.devel

Subject: mutator not called on empty value?

Hi!

It seems that mutators are not called if the value is None. Has this some
reason? I am actually trying to do something like the file type and
deriving the ID from the filename of the uploaded file. But in this
case the id is empty and thus my mutator is not called and thus the id
not set.

Moreover I think it makes sense to pass all the fields to the mutator as
in this case it's also dependant on these (now I fetch everything from
the request). Maybe it makes sense to create some sort of data object
which holds all the values and pass this to every mutator. Thes
data object might then hold the right values already. In my case the
requests now has a field "file_file" for my schema field "file". This
might then be converted already.

This change might need some different mutator attribute then in order to
provide backwards compatibility.

But mist important is the first question as I would change this then.
So any objections?

-- christian

PS: referring to code in _processForm() in BaseObject.py

--
COM.lounge http://comlounge.net/
communication & design
info-WV3Fc3dYO6sqcZcGjlUOXw@xxxxxxxxxxxxxxxx


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise