Re: [Zope-dev] Zope 2.3.1b1, strange things when ConflictError.

2001-02-26 Thread Erik Enge

On Sun, 25 Feb 2001, Steve Alexander wrote:

 I wasn't reading the code clearly the first time around.
 
 By far the simplest place to return copied results from methodB is to 
 change the last line to

Thanks, it all works nice.  Nearly, that is.  

The reverse problem is now gone.  But the fact that every time I get a
ConflictError it doesn't "flush" the 'objects' of methodB, and just seems
to append to it, still remains.

I only get this when a ConflictError occur.


___
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] Zope 2.3.1b1, strange things when ConflictError.

2001-02-26 Thread Erik Enge

On Mon, 26 Feb 2001, Erik Enge wrote:

 I only get this when a ConflictError occur.

Nope, it occurs every time I change to another object.  I need to do some
more testing here.  It seems as if the 'objects' variable of 'methodB' is
semi-persistent or something.  Weired.


___
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] Zope 2.3.1b1, strange things when ConflictError.

2001-02-26 Thread Chris McDonough

The use of a literal anonymous list in methodb's signature for "objects" may
have something to do with the results you're getting on conflict.  Try
assigning "objects" to an empty list in the method body instead.

- Original Message -
From: "Erik Enge" [EMAIL PROTECTED]
To: "Steve Alexander" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, February 26, 2001 5:46 AM
Subject: Re: [Zope-dev] Zope 2.3.1b1, strange things when ConflictError.


 On Sun, 25 Feb 2001, Steve Alexander wrote:

  I wasn't reading the code clearly the first time around.
 
  By far the simplest place to return copied results from methodB is to
  change the last line to

 Thanks, it all works nice.  Nearly, that is.

 The reverse problem is now gone.  But the fact that every time I get a
 ConflictError it doesn't "flush" the 'objects' of methodB, and just seems
 to append to it, still remains.

 I only get this when a ConflictError occur.


 ___
 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 )



Re: [Zope-dev] Zope 2.3.1b1, strange things when ConflictError.

2001-02-26 Thread Steve Alexander

Chris McDonough wrote:

 The use of a literal anonymous list in methodb's signature for "objects" may
 have something to do with the results you're getting on conflict.  Try
 assigning "objects" to an empty list in the method body instead.

Of course! Yet another demonstration of the dangers of using mutable objects 
carelessly :-)

--
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] Zope 2.3.1b1, strange things when ConflictError.

2001-02-26 Thread Steve Alexander

Erik Enge wrote:

 
  The reverse problem is now gone.  But the fact that every time I get
   a ConflictError it doesn't "flush" the 'objects' of methodB, and
  just seems to append to it, still remains.
 
  I only get this when a ConflictError occur.

I don't know exactly why this might happen. I'd need to reproduce the 
problem, and look through things with a debugger, or instrument the code 
with print statements or something like that.

Perhaps you've found a bug (or feature) in the support for concurrency 
in Extension Class.

You can probably work around the problem, and get faster code into the 
bargain: rewrite methodB so that it is not recursive.

--
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] Zope 2.3.1b1, strange things when ConflictError.

2001-02-26 Thread Erik Enge

On Mon, 26 Feb 2001, Steve Alexander wrote:

 Chris McDonough wrote:
 
  The use of a literal anonymous list in methodb's signature for "objects" may
  have something to do with the results you're getting on conflict.  Try
  assigning "objects" to an empty list in the method body instead.
 
 Of course!

I'm missing out on something here.  Why is this an "of course"?  What's a
"literal anonymous list"?


___
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] Zope 2.3.1b1, strange things when ConflictError.

2001-02-26 Thread Steve Alexander

Erik Enge wrote:

 On Mon, 26 Feb 2001, Steve Alexander wrote:
 
 
 Chris McDonough wrote:
 
 
 The use of a literal anonymous list in methodb's signature for "objects" may
 have something to do with the results you're getting on conflict.  Try
 assigning "objects" to an empty list in the method body instead.
 
 Of course!
 
 
 I'm missing out on something here.  Why is this an "of course"?  What's a
 "literal anonymous list"?

Consider this method:

   def methodFoo(self, objects=[]):
 # do stuff, including altering the list objects

The list that is assigned to "objects" in the definition of arguments is 
only created once. There is only one instance of the list for all the 
calls to methodFoo. If you alter that list, then it is altered for the 
future too.

Try it in Python from the interactive prompt:

  def foo(o=[]):
...   o.append('x')
...   print o
...
  foo()
['x']
  foo()
['x', 'x']
  foo()
['x', 'x', 'x']
 

--
Steve Alexander
Software Engineer
Cat-Box limited


___
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] ZCatalog problems

2001-02-26 Thread Morten W. Petersen

Hi guys,

I'm having trouble making ZCatalog work.  The problem is that
there are 29 objects of a given meta type, with the same
booleans that should be returned for an iteration; but only
20 are.  Is this a result of caching perhaps?  Or lazy
results?

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 problems

2001-02-26 Thread Steve Alexander

Morten W. Petersen wrote:

  Hi guys,
 
  I'm having trouble making ZCatalog work.  The problem is that there
  are 29 objects of a given meta type, with the same booleans that
  should be returned for an iteration; but only 20 are.  Is this a
  result of caching perhaps?  Or lazy results?

Could be that your objects have different ideas of what are proper 
boolean values.

I assume you're using a FieldIndex. Try calling 
uniqueValuesFor(index_name) to see what values are stored. You may find 
that you have 0, 1, '1' and '', for example.

In situations like that, I get the unique values, then construct a query 
for the catalog based on the true or false values.

To get the true values, something like

   Catalog(boolean_index=
filter(None, Catalog.uniqueValuesFor('boolean_index'))

To get the false ones:

   Catalog(boolean_index=
 filter(lambda x: not x,
Catalog.uniqueValuesFor('boolean_index'))

--
Steve Alexander
Software Engineer
Cat-Box limited


___
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 problems

2001-02-26 Thread Chris McDonough

Neat!

- Original Message - 
From: "Steve Alexander" [EMAIL PROTECTED]
To: "Morten W. Petersen" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, February 26, 2001 1:31 PM
Subject: Re: [Zope-dev] ZCatalog problems


 Morten W. Petersen wrote:
 
   Hi guys,
  
   I'm having trouble making ZCatalog work.  The problem is that there
   are 29 objects of a given meta type, with the same booleans that
   should be returned for an iteration; but only 20 are.  Is this a
   result of caching perhaps?  Or lazy results?
 
 Could be that your objects have different ideas of what are proper 
 boolean values.
 
 I assume you're using a FieldIndex. Try calling 
 uniqueValuesFor(index_name) to see what values are stored. You may find 
 that you have 0, 1, '1' and '', for example.
 
 In situations like that, I get the unique values, then construct a query 
 for the catalog based on the true or false values.
 
 To get the true values, something like
 
Catalog(boolean_index=
 filter(None, Catalog.uniqueValuesFor('boolean_index'))
 
 To get the false ones:
 
Catalog(boolean_index=
  filter(lambda x: not x,
 Catalog.uniqueValuesFor('boolean_index'))
 
 --
 Steve Alexander
 Software Engineer
 Cat-Box limited
 
 
 ___
 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 )



[Zope-dev] catalog object owners?

2001-02-26 Thread Tim McLaughlin

Anybody know how to catalog the object "owner"?  I can't seem to find a
property to catalog the value of getUserName().  (of course I could always
kludge it with a property in the constructor, but I would prefer use what is
already there).

___
Tim McLaughlin  BCSwebservices.net
Director, Technical Group   1950 Old Gallows Road
tel:  (703) 790.8081 x111   Suite 201
[EMAIL PROTECTED]  Vienna, VA 22182
www .bcswebservices. 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] catalog object owners?

2001-02-26 Thread Morten W. Petersen

[Tim McLaughlin]

| Anybody know how to catalog the object "owner"?  I can't seem to find a
| property to catalog the value of getUserName().  (of course I could always
| kludge it with a property in the constructor, but I would prefer use what is
| already there).

I'll second that, the ability to catalog values returned by method calls
would be sweet..

-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] catalog object owners?

2001-02-26 Thread Chris McDonough

 I'll second that, the ability to catalog values returned by method calls
 would be sweet..

Not sure what you mean, this works now.


___
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] catalog object owners?

2001-02-26 Thread Chris McDonough

getOwner should do it.  This will return the actual owner object.  It'd be
preferable to catalog the tuple representing the owner path (this is
returned by getOwner(1)), so you might want to create a method on the object
that returns "getOwner(1)".

- Original Message -
From: "Tim McLaughlin" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 26, 2001 3:38 PM
Subject: [Zope-dev] catalog object owners?


 Anybody know how to catalog the object "owner"?  I can't seem to find a
 property to catalog the value of getUserName().  (of course I could always
 kludge it with a property in the constructor, but I would prefer use what
is
 already there).

 ___
 Tim McLaughlin BCSwebservices.net
 Director, Technical Group1950 Old Gallows Road
 tel:  (703) 790.8081 x111 Suite 201
 [EMAIL PROTECTED] Vienna, VA 22182
 www .bcswebservices. 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 )



___
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] catalog object owners?

2001-02-26 Thread Morten W. Petersen

[Chris McDonough]

|  I'll second that, the ability to catalog values returned by method calls
|  would be sweet..
| 
| Not sure what you mean, this works now.

Aha?  So if I specify a field index of, get_parent_node_id, which is a
function call on all objects that are to be indexed, this would
index the returned value?

If so, how long has this been available?

Cheers,

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] catalog object owners?

2001-02-26 Thread Tim McLaughlin

how?  I can't seem to do it.  (I'm sure that I'm just being daft though).  I
tried both "title_and_id" and "title_and_id()" to no avail.

-Original Message-
From: Chris McDonough [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 4:51 PM
To: Tim McLaughlin; Morten W. Petersen
Cc: [EMAIL PROTECTED]
Subject: Re: [Zope-dev] catalog object owners?


 I'll second that, the ability to catalog values returned by method calls
 would be sweet..

Not sure what you mean, this works now.

___
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] catalog object owners?

2001-02-26 Thread Tim McLaughlin

never mind.  dumb mistake.

Thanks.

-Original Message-
From: Tim McLaughlin 
Sent: Monday, February 26, 2001 4:37 PM
To: 'Chris McDonough'; Tim McLaughlin; Morten W. Petersen
Cc: [EMAIL PROTECTED]
Subject: RE: [Zope-dev] catalog object owners?


how?  I can't seem to do it.  (I'm sure that I'm just being daft though).  I
tried both "title_and_id" and "title_and_id()" to no avail.

-Original Message-
From: Chris McDonough [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 4:51 PM
To: Tim McLaughlin; Morten W. Petersen
Cc: [EMAIL PROTECTED]
Subject: Re: [Zope-dev] catalog object owners?


 I'll second that, the ability to catalog values returned by method calls
 would be sweet..

Not sure what you mean, this works now.

___
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] catalog object owners?

2001-02-26 Thread Steve Alexander

Morten W. Petersen wrote:

 
 Aha?  So if I specify a field index of, get_parent_node_id, which is a
 function call on all objects that are to be indexed, this would
 index the returned value?

yes.

 If so, how long has this been available?

Absolutely ages!
At least since 2.2. I don't have any 2.1 installs around to check with.

--
Steve Alexander
Software Engineer
Cat-Box limited


___
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] strip_html?

2001-02-26 Thread R. David Murray

I searched the NIP archives but didn't get any hits on strip_html.  Is the
code for this beast (used by zope.org to strip html out of partial text
included from another page) available anywhere?

--RDM


___
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] catalog object owners?

2001-02-26 Thread Chris McDonough

 Aha?  So if I specify a field index of,
 get_parent_node_id, which is a
 function call on all objects that are to be indexed, this
 would
 index the returned value?
 
 If so, how long has this been available?

As long as the catalog has been around, AFAICT...

This is one of its very most basic features.

___
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] More ZCatalog Stuff.

2001-02-26 Thread Michael R. Bernstein

Toby Dickenson wrote:
 
 If you are interested in a short-term hack, it is possible implement
 your own type of index and add it to an existing catalog, without
 having to modify any of the ZCatalog product.

Ok, how? Please keep in mind that I'm more of a designer and
integrator than a coder.

Thanks,

Michael Bernstein.

___
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] How to build indexes in the MemberCatalog ofMembership Component?

2001-02-26 Thread Bill Anderson

On 23 Feb 2001 18:13:37 -0800, Dirksen wrote:
 Hi Bill,
 
 When I open the 'find objects' tab in MemberCatalog, I can't see 'PortalMember' in 
'find
 object in type' selection field. How to build indexes then? Thanks in advance!


Sorry for the delay, that's what i get for living on the bleeding edge
of Evolution*.

Note: Creating an index is not done via the 'find; page, but rather the
indexes page. What you are describing is cataloging currently existing
objects. As to why Portal member doesn't show up, I don't know.

I use, and recommend the use of a ZPattern trigger. You can get it by
downloading the DataSkins product. This way, whenever a member is
modified, it automatially updates/creates it's entry in the catalog.
Just be sure to specify MemberCatalog :)

Bill


* Evolution decided it didn't want to compose messages anymore ...



___
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] Search Features and Zope Directions Road Map

2001-02-26 Thread Ausum

Zope is a great application server, the same as its soon to be released Content
Management Framework, because of  its bet on Python, everybody say it.
Nevertheless, after reading the Directions Roadmap from DC, I was surprised that
a substantial improvement of the searching features of Zope, wasn't mentioned as
a major concern.

For a new Zope enthusiast like me, it is a kind of addiction to arrange and
administer content while taking the learning curve. Almost everybody in this
list with a non-programming background might've experimented this. But when I
arrived to the search features of ZCatalog, I got mixed feelings. (Right now I'm
stuck on this OR indexes searching :)  )

The fact is that - according to my strong belief - everybody uses more Google to
look for Zope Site's content than Zope's own Zcatalog's search engine. Moreover,
everybody uses more Google to look for everything, bypassing windows, doors, and
portals!. Why? Because it's terribly smart (not mentioning its 6,000 Linux
boxes, by the way), and because there's no need to follow the highly-engineered
information architecture of a web site, if there's a trustful shorcut to the
relevant content!. So, if I'd have to mention one big feature improvement to
Zope, I wouldn't doubt: "search engine".

I just wanted to point on this subject. I know Zope isn't about spidering and
retrieving, but it should have "Greater Search Capabilities" as a title, within
that roadmap.  :)



Ausum



p.d.   Right now I'm quite interested at the technology of searching and finding
non structured content, in order to compose structured documents. For example,
the guys at Vignette (StoryServer) say that its customers don't need to keyword
anything in order to have a "related content" section. After the writer finishes
a story, (possibly while) a routine by Autonomy (www.autonomy.com) reads the
document and finds out what the document is about, and so it triggers a search
for related content within the site, without the need of intervention by the
writer.  (For the curious, Autonomy has published a personal version of its
software. It's called Kenjin (www.kenjin.com) ). On the other hand, Fast, from
Norway, already have a nice multimedia search engine, from regular,
non-structured, spidered web pages. Can we do that "structuring the
unstructured" thing within 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 )