[Zope-dev] Turning acquisition off[Zope-dev] Turning acquisition off

2000-12-06 Thread morten

Hi guys,

Does anyone know how to disable acqusition ?

That is, with a simple method, and not disabling the Acqusition class,
something like self.aq_disabled('attribute') .

Thanks.

-Morten


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] ZCatalog scalability...

2000-12-06 Thread Chris Withers

John Eikenberry wrote:
 
 the potential of up
 to 50,000 entries. 

 Using a ZCatalog for
 listings

This may cause you real problems, especially if there's a 'bulk data
load' at any point.

Cheers,

Chris

PS: How's the catalog revamp coming along? Any published ZSearch
interface yet?

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Turning acquisition off selectively.

2000-12-06 Thread Chris Withers

[EMAIL PROTECTED] wrote:
 
 That is, with a simple method, and not disabling the Acqusition class,
 something like self.aq_disabled('attribute') .

So kindof the inverse of using Aquisition.Explicit and using the
aq_acquire method?

What you describe would be really cool...

The only workaround for now is to use calls to ac_acquire() and provide
a filter function, but this doesn't help when other code that you have
no control over accesses an attribute that you'd rather not have
acquired :-(

cheers,

Chris

PS:
http://www.zope.org/Members/michel/Projects/Interfaces/AcquisitionWrappedObject

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Turning acquisition off selectively.

2000-12-06 Thread Robin Becker

I'm almost beginning to understand Acquisition. I can see that it's
possible to control the things that my class acquires ie import or
ancestor acquisition control, but is it possible to control what other
classes acquire from me sort of export/descendant control.
-- 
Robin Becker

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Turning acquisition off[Zope-dev] Turning acquisitionoff

2000-12-06 Thread Ken Manheimer

On Wed, 6 Dec 2000 [EMAIL PROTECTED] wrote:

 Does anyone know how to disable acqusition ?
 
 That is, with a simple method, and not disabling the Acqusition class,
 something like self.aq_disabled('attribute') .

I believe one way is self.aq_base['attribute'].  aq_base gets the
unwrapped object (what got __of__'ed).  If you're not sure the thing
is acquisition-wrapped in the first place, you'd probably want to check
for the existing of the 'aq_base' attribute before using it...

Ken Manheimer
[EMAIL PROTECTED]


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Turning acquisition off

2000-12-06 Thread Chris Withers

Ken Manheimer wrote:
 
 On Wed, 6 Dec 2000 [EMAIL PROTECTED] wrote:
 
  Does anyone know how to disable acqusition ?
 
  That is, with a simple method, and not disabling the Acqusition class,
  something like self.aq_disabled('attribute') .
 
 I believe one way is self.aq_base['attribute'].  aq_base gets the
 unwrapped object (what got __of__'ed). 

What if the base object's not a dictionary?

 If you're not sure the thing
 is acquisition-wrapped in the first place, you'd probably want to check
 for the existing of the 'aq_base' attribute before using it...

Am I imagining things of did Jim F say he might make ac_base present in
all the acquisition classes so that kind of checking isn't necessary?

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Turning acquisition off

2000-12-06 Thread Ken Manheimer

On Wed, 6 Dec 2000, Chris Withers wrote:

 Ken Manheimer wrote:
  
  On Wed, 6 Dec 2000 [EMAIL PROTECTED] wrote:
  
   Does anyone know how to disable acqusition ?
  
   That is, with a simple method, and not disabling the Acqusition class,
   something like self.aq_disabled('attribute') .
  
  I believe one way is self.aq_base['attribute'].  aq_base gets the
  unwrapped object (what got __of__'ed). 
 
 What if the base object's not a dictionary?

I suspect i was missing something, but i assumed since he was referring to
an attribute of the object, that morten did not mean to write a function
call form.  I probably should have presumed toward attribute lookup:
self.aq_base.attribute or getattr(self.aq_base, 'attribute') - and been
explicit that i was reading between the lines, in the first place.

  If you're not sure the thing
  is acquisition-wrapped in the first place, you'd probably want to check
  for the existing of the 'aq_base' attribute before using it...
 
 Am I imagining things of did Jim F say he might make ac_base present in
 all the acquisition classes so that kind of checking isn't necessary?

Dunno.

Ken
[EMAIL PROTECTED]


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Turning acquisition off

2000-12-06 Thread Stefan H. Holek

On Wed, 6 Dec 2000 [EMAIL PROTECTED] wrote:

 Does anyone know how to disable acqusition ?
 
 That is, with a simple method, and not disabling the Acqusition class,
 something like self.aq_disabled('attribute') .

Might this be what you are looking for?

http://www.egroups.com/message/zope/45049

Regards,
Stefan


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] case insensitive sorts

2000-12-06 Thread Andy McKay

Minor nit and patch: I've found that really for me what users want to see is
a case insensitive sort of objects, not the current python case sensitive
sort. So that the order of objects from dtml-in and tree is a, A, b, B as
apposed to A, B, a, b.

Anyway Ive patched dtml-in and dtml-tree to do this sort on a ignore_case
tag. Is this useful to anyone else? And Ive thought of patching my Zope so
this is the default behaviour what does anyone else think. The next
thing to patch is ZCatalog...


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] case insensitive sorts

2000-12-06 Thread Steve Alexander

Andy McKay wrote:

 Minor nit and patch: I've found that really for me what users want to see is
 a case insensitive sort of objects, not the current python case sensitive
 sort. So that the order of objects from dtml-in and tree is a, A, b, B as
 apposed to A, B, a, b.
 
 Anyway Ive patched dtml-in and dtml-tree to do this sort on a ignore_case
 tag. Is this useful to anyone else? And Ive thought of patching my Zope so
 this is the default behaviour what does anyone else think. The next
 thing to patch is ZCatalog...


The way I approached this was to have a ZPatterns attribute provider, or 
a method, that provides a modified version of the value I want to sort on.

For example, I have a load of documents and folders with titles like

  Big Folder

  brown document

  "Berries for Cooking" list

I wanted to present these sorted by non-case-sensitive first letter or 
number. So, I made a method "title_for_sorting" that stripped off any 
punctuation at the start, and returned the first 20 characters in all 
lower case.  In this case, as it was a ZPatterns application, the method 
was presented as an attribute of the object using some skin-script. I 
used this attribute as a field-index in my SiteIndex ZCatalog.

The reason I mention this is that sometimes case-insensitivity is not 
enough for sensible sorting. In this case, I had to strip out 
punctuation too.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] ZUnit - feedback convocation

2000-12-06 Thread Lalo Martins

On Mon, Dec 04, 2000 at 02:56:26PM -0800, Michel Pelletier wrote:
 On Mon, 4 Dec 2000, Lalo Martins wrote:
 
  The first section is the advocacy section; it will begin with
  "if you already do unit tests, you may want to skip this
  section". I'm not sure if the history lesson is out of scope,
  but "Why do you want to use it" is probably better.
 
 Hmm... actually in that case you may want to axe both "why" and the history.

I agree. At most, one paragraph about each could go in "What
is Unit Testing".

   What does "refactor mercilessly!" mean?
  
  I'll explain that one of the benefits of unit testing
  extensively is that you can modify your code without fear
  (you'll know when it breaks). This section is more advocacy
  than technical.
 
 Ah, ok I like it.  I wonder if "refactor" is the right word; it's very
 specific and it sounds like any kind of changing can be done.

"Refactor Mercilessly!" is one of the "practices" of XP, and an
expression (XPression?) they like to throw around.

Also, yes, any kind of changing can be done, if the tests cover
it :-) (except that if you develop new functionality, you must
write new tests too)


  I allocated a subsection for this because just explaining the
  problem is already somewhat convoluted, as you see above ;-) in
  a printed book, I'd make it a sidebar or something, but...
 
 Hmm.  I guess my concern was because it was the only subsection of
 'Fixtures'.  Do fixtures need a more topical breakdown or are they
 simple enough to sum up in one section?  Maybe we can think of some
 'fixture use cases'.

I don't think so. I think I just broke the rules. When I added
this subsection I was thinking more about some kind of sidebar,
not a real subsection - fixtures definitely don't need their
own topical breakdown.

As there is no provision for "sidebars" or "boxes" in the
informal standard format we've been using for these docs,
I'll move the note about this issue one level up.

[]s,
   |alo
   +
--
  Hack and Roll ( http://www.hackandroll.org )
The biggest site for whatever-it-is-that-we-are.


http://zope.gf.com.br/lalo   mailto:[EMAIL PROTECTED]
 pgp key: http://zope.gf.com.br/lalo/pessoal/pgp

Brazil of Darkness (RPG)--- http://zope.gf.com.br/BroDar

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] SQLAlias Memory Leak?

2000-12-06 Thread Dyon Balding

OK, I've had more of a hack at this, and I've narrowed the problem
down a little.

It appears that any access to an SQLAlias object causes it to not
be correctly released.  The SQLAlias objects means that you can
access column names using a different case to how they are stored
in the database.

For example, we store users in a users table in the database, with
column names like USERNAME, but they are accessed with:
dtml-var username, this causes the SQLAlias objects to stick around.

One solution to our problem is to just do a dtml-var USERNAME
instead.  However that doesn't solve the problem with this
"feature" of being able to call it with a different case.

This is a fairly easy bug to reproduce, on my setup at least :).
I have tested it with ZSQLRelay and ZODBDA both talking to SQLServer,
and with ZPyGreSQLDA talking to PostgreSQL.

I would appreciate it if someone else can reproduce the bug,
and I'll put it in the Collector I guess.

thanks
-d

On Wed, Dec 06, 2000 at 09:06:47AM +1100, Dyon Balding wrote:
 Hi,
 
 I have an application that stores state data in a
 SQLServer database.  The Zope and database servers
 run on different windows machines, using the ZODBCDA
 product to connect Zope to the ODBC machinery.
 
 What I have been observing is that the Zope client's
 memory usage increases consistently when ZSQL methods
 are being called.  In the Debug screens, the
 culprit appears to be Shared.DC.ZRDB.RDB.SQLAlias.
 
 Here's a dump of the first few lines after hitting
 a ZSQL method a few hundred times using ab.  The
 SQLAlias figures never seem to go down.
 
 Class 
 December 5, 2000
 1:58 pm 
  December 5, 2000
  2:01 pm 
  
Delta 
 Shared.DC.ZRDB.RDB.SQLAlias 
 1048 
  4068 
  
+3020 
 ZClasses.ZClass.ZClass 
 73 
  108 
  
+35 
 OFS.DTMLMethod.DTMLMethod 
 63 
  94 
  
+31 
 
 In fact most of our servers run out of memory and need
 to be restarted every couple of days when they get
 sufficient use.
 
 I've done a bit of a search of the mailing lists, and noone
 else appears to be having the same problem.  So does
 anyone have an idea of what we might be doing differently
 to everyone else?  We appear to have the latest versions
 installed.
 
 I've had a bit of a look through the code, and it appears
 that SQLAlias is used to case desensitize the column names
 of the returned data?
 
 Any pointers would be appreciated.
 
 thanks, d
 
 -- 
 |Dyon Balding [EMAIL PROTECTED] |
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )

-- 
Dyon Balding [EMAIL PROTECTED]

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] case insensitive sorts

2000-12-06 Thread Andy McKay

Oh yeah for the ZCatalog I have two indexes one upper case and one lower
case for some of my classes. No problemo. My area to attack though is the
standard views such as the management interface...

How's life in Lancaster? Went to school there and grew up in Garstang

--
  Andy McKay, Developer.
  ActiveState.

- Original Message -
From: "Steve Alexander" [EMAIL PROTECTED]
To: "Andy McKay" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, December 06, 2000 11:03 AM
Subject: Re: [Zope-dev] case insensitive sorts


 Andy McKay wrote:

  Minor nit and patch: I've found that really for me what users want to
see is
  a case insensitive sort of objects, not the current python case
sensitive
  sort. So that the order of objects from dtml-in and tree is a, A, b, B
as
  apposed to A, B, a, b.
 
  Anyway Ive patched dtml-in and dtml-tree to do this sort on a
ignore_case
  tag. Is this useful to anyone else? And Ive thought of patching my Zope
so
  this is the default behaviour what does anyone else think. The next
  thing to patch is ZCatalog...


 The way I approached this was to have a ZPatterns attribute provider, or
 a method, that provides a modified version of the value I want to sort on.

 For example, I have a load of documents and folders with titles like

   Big Folder

   brown document

   "Berries for Cooking" list

 I wanted to present these sorted by non-case-sensitive first letter or
 number. So, I made a method "title_for_sorting" that stripped off any
 punctuation at the start, and returned the first 20 characters in all
 lower case.  In this case, as it was a ZPatterns application, the method
 was presented as an attribute of the object using some skin-script. I
 used this attribute as a field-index in my SiteIndex ZCatalog.

 The reason I mention this is that sometimes case-insensitivity is not
 enough for sensible sorting. In this case, I had to strip out
 punctuation too.

 --
 Steve Alexander
 Software Engineer
 Cat-Box limited
 http://www.cat-box.net



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] case insensitive sorts

2000-12-06 Thread Dieter Maurer

Andy McKay writes:
   what does anyone else think

I would not like it.


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] case insensitive sorts

2000-12-06 Thread Rik Hoekstra



 Andy McKay wrote:

  Minor nit and patch: I've found that really for me what users want to
see is
  a case insensitive sort of objects, not the current python case
sensitive
  sort. So that the order of objects from dtml-in and tree is a, A, b, B
as
  apposed to A, B, a, b.
 
  Anyway Ive patched dtml-in and dtml-tree to do this sort on a
ignore_case
  tag. Is this useful to anyone else? And Ive thought of patching my Zope
so
  this is the default behaviour what does anyone else think. The next
  thing to patch is ZCatalog...


 The way I approached this was to have a ZPatterns attribute provider, or
 a method, that provides a modified version of the value I want to sort on.

 For example, I have a load of documents and folders with titles like

   Big Folder

   brown document

   "Berries for Cooking" list

 I wanted to present these sorted by non-case-sensitive first letter or
 number. So, I made a method "title_for_sorting" that stripped off any
 punctuation at the start, and returned the first 20 characters in all
 lower case.  In this case, as it was a ZPatterns application, the method
 was presented as an attribute of the object using some skin-script. I
 used this attribute as a field-index in my SiteIndex ZCatalog.

 The reason I mention this is that sometimes case-insensitivity is not
 enough for sensible sorting. In this case, I had to strip out
 punctuation too.

Hm, reading this... just a loose comment.
In light of the awkward search interface of ZCatalogs, would it be a good
idea to make a search interface for ZCatalog ZPatterns based? This would add
the possibility to make it configurable wrt case sensitivity, and to do nice
things with ANDing and ORing different kinds of indexes.
The only thing I can't judge whether it would be possible to make this
generic enough.

for-what-it's-worth

Rik


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] SQLAlias Memory Leak?

2000-12-06 Thread Jon Prettyman

I've seen this as well under DCOracle.

-jon

Dyon Balding [EMAIL PROTECTED] writes:

 OK, I've had more of a hack at this, and I've narrowed the problem
 down a little.
 
 It appears that any access to an SQLAlias object causes it to not
 be correctly released.  The SQLAlias objects means that you can
 access column names using a different case to how they are stored
 in the database.
 
 For example, we store users in a users table in the database, with
 column names like USERNAME, but they are accessed with:
 dtml-var username, this causes the SQLAlias objects to stick around.
 
 One solution to our problem is to just do a dtml-var USERNAME
 instead.  However that doesn't solve the problem with this
 "feature" of being able to call it with a different case.
 
 This is a fairly easy bug to reproduce, on my setup at least :).
 I have tested it with ZSQLRelay and ZODBDA both talking to SQLServer,
 and with ZPyGreSQLDA talking to PostgreSQL.
 
 I would appreciate it if someone else can reproduce the bug,
 and I'll put it in the Collector I guess.
 
 thanks
 -d
 
 On Wed, Dec 06, 2000 at 09:06:47AM +1100, Dyon Balding wrote:
  Hi,
  
  I have an application that stores state data in a
  SQLServer database.  The Zope and database servers
  run on different windows machines, using the ZODBCDA
  product to connect Zope to the ODBC machinery.
  
  What I have been observing is that the Zope client's
  memory usage increases consistently when ZSQL methods
  are being called.  In the Debug screens, the
  culprit appears to be Shared.DC.ZRDB.RDB.SQLAlias.
  
  Here's a dump of the first few lines after hitting
  a ZSQL method a few hundred times using ab.  The
  SQLAlias figures never seem to go down.
  
  Class 
  December 5, 2000
  1:58 pm 
   December 5, 
2000
   2:01 pm 
 
  Delta 
  Shared.DC.ZRDB.RDB.SQLAlias 
  1048 
   4068 
 
  +3020 
  ZClasses.ZClass.ZClass 
  73 
   108 
 
  +35 
  OFS.DTMLMethod.DTMLMethod 
  63 
   94 
 
  +31 
  
  In fact most of our servers run out of memory and need
  to be restarted every couple of days when they get
  sufficient use.
  
  I've done a bit of a search of the mailing lists, and noone
  else appears to be having the same problem.  So does
  anyone have an idea of what we might be doing differently
  to everyone else?  We appear to have the latest versions
  installed.
  
  I've had a bit of a look through the code, and it appears
  that SQLAlias is used to case desensitize the column names
  of the returned data?
  
  Any pointers would be appreciated.
  
  thanks, d
  
  -- 
  |Dyon Balding [EMAIL PROTECTED] |
  
  ___
  Zope-Dev maillist  -  [EMAIL PROTECTED]
  http://lists.zope.org/mailman/listinfo/zope-dev
  **  No cross posts or HTML encoding!  **
  (Related lists - 
   http://lists.zope.org/mailman/listinfo/zope-announce
   http://lists.zope.org/mailman/listinfo/zope )
 
 -- 
 Dyon Balding [EMAIL PROTECTED]
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )