[Zope-dev] ZPatterns alpha 4 released (was Re: ZPatterns bug. Very serious.)

Phillip J. Eby pje@telecommunity.com
Sun, 25 Jun 2000 12:31:47 -0500


ZPatterns 0.4.0 alpha 4 has been released, fixing the bugs described below.
 I will be away from e-mail most of this coming week.  If when I get back
there isn't a pile of new bug reports, I'll upgrade ZPatterns to beta
status.  On Friday, Ty completed a project using LDAP and ZPatterns'
"generic attribute providers" and "generic triggers" to perform an actual
useful function for our department, and it should be in production use this
coming week.  So 0.4.0 is starting to look pretty stable.


At 09:49 PM 6/23/00 +0800, mike@flic.net wrote:
>
>1. Install product as usual
>2. Import ZSessionTest (ZClass)
>3. Create an instance of ZSession
>4. Go 'Racks' tab, then deep into SessionSource, then select 'Storage'
>tab
>5. Make sure ZSessionTest is the 'Class to use for stored items'
>6. Go to the Session level
>7. Select 'View' tab to allocate the session object
>8. Go back and select 'Contents' tab. You should see a table with one
>live session.
>9. Click on the session's id
>10. You should see the only 'View' tab
>11. Restart Zope server to drop the caches
>12. Refresh frame. Now you see two more tabs!
>
>The reason why the tabs was not visible first time is the wrong REQUEST
>object, acquired by App/Management.py/filter_manage_options method. When
>the zope server restarts (and caches get cleared), acquisition works OK.

I think I found the problems.  First, Rack.newItem() sets
slot[SelfKey]=item when it should be item.aq_base.  And second,
Rack.retrieveItem() fails to wrap the returned object to the specialist.
(Instead of returning item on the last line of the function, it should
return item.__of__(self.aq_inner.aq_parent)).  These problems affected only
objects whose primary storage was in the ZODB (a mode of storage Ty and I
aren't currently using much, as our projects are focused on LDAP at the
moment).

Once these changes are made, one can safely remove all the places where you
were taking session.__of__(self), since the Rack provides an equivalent
effect.

I was not able to import your .zexp file, so I did the best I could to
simulate your test conditions.  I got somewhat different errors, but like
yours they occurred only when adding new items and went away once Zope had
been reset.  With the changes, everything seems to work fine.



>P.S. About the Shoping Cart. I've realized that Cart is also bad
>concept. There are no shopping carts in real life, 

When's the last time you went to the grocery store?  :)


> but relations between
>Shoppers and reserved Products, which *can* (but not *should*) be
>arranged as shopping carts. So, in most common case there should be a
>Clerk which able to set up and maintain those relations.

The purpose, IMHO, of a shopping cart, is the same as in a store...  to
gather the items you intend to purchase at one time in a single place, in a
convenient way, allowing you to browse through the store rather than having
to make a list and then request all the things at once from the "clerk".
If you have only the "clerk", then you lose your ability to browse the
store, and commit your purchase as a single transaction.  Or if you make it
possible to do those things, all you've done is re-invented the cart under
a different name.