[Zope-dev] zpatterns-0.4: creating an item in "virtual mode"

Phillip J. Eby pje@telecommunity.com
Wed, 05 Jul 2000 20:03:20 -0500


At 11:14 AM 7/5/00 +0400, Jephte CLAIN wrote:
>Hello,
>
>I use virtual attribute access to provide access to my SQL database.
>However, I want to use the Rack.newItem facility to create new records
>in the database.
>But it fails because in virtual mode, an item always exists.
>This patch solves the problem, at least for me
>
> 
>         # XXX What if all items potentially exist?
> 
>comments?
>

The XXX comment shown above says it all.  :)  Actually, all it says is that
I knew the problem you're having would happen.  However, if I put your
patch in, I now have to have one that said:

	  # XXX What if object already exists in virtual mode?

That having been said, I will think about adding your patch, or
alternatively a storage setting that tells the Rack whether to check for
existence before adding new items.  This setting would default to being
true, so you could change it for your circumstance, which is a fairly
special case, I think.