[Zope-dev] ZCatalog FieldIndex Bug (Fix?)

2001-04-06 Thread Chris Withers

Chris Withers wrote:
 Correct me if I'm wrong, but if I query a field index with an empty string, I
 expect to get returned all catalogued objects where that attribute's value _is_
 the empty string.
 
 Anyway, this happens most of the time and I wish it happened all the time.
 Basically, the only situation where this _doesn't_ happen is when _none_ of the
 objects catalogued in the field index have a value of the empty string, which
 seems really bug and nasty to me ;-)

I think I've got a solution, but I dunno if it's right. The patch is at the end.
How do I get the unit tests in ZCatalog/tests to run so I can check I haven't
screwed anything else up?

cheers,

Chris

E:\Zope\2.3.1\lib\python\SearchIndexdiff -u unindex.py.old unindex.py
--- unindex.py.old  Thu Apr 05 23:35:40 2001
+++ unindex.py  Thu Apr 05 23:37:46 2001
@@ -407,9 +407,9 @@

 if r is None:
 if anyTrue:
-r=IISet()
-else:
 return None
+else:
+r=IISet()

 return r, (id,)


___
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] Possible ZCatalog Bug

2001-04-06 Thread Chris Withers

Edmund,

This smells like the otehr side of the weird behaviour I was experiencing. You
haven't got any FieldIndexes in there, one of which may have some empty strings
indexde in it?

Anyway, Try applying the patch in this message I posted to zope-dev this morning
"ZCatalog FieldIndex Bug (Fix?)"
...and let me know if it helps (or if it breaks everything ;-)

cheers,

Chris (!M) ;-)

___
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] Strange errors in the log

2001-04-06 Thread Chris Withers

Joachim Werner wrote:

 For us, it definitely is not the Catalog. The site I saw the error first
 uses just ZClasses (with catalogAware subclassed, but that should not be
 relevant) and
 Core Session Tracking (not the release from this week, the last one).
 
 It seems to come up after a while, maybe when sessions expire or so ...

Okay, so that does seem to narrow it down to CST. We don't have any Zope
instances that _are_ displaying this behaviour but _aren't_ using CST, so it
seems to tie in with what you're saying...

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] ZCatalog FieldIndex Bug (Fix?)

2001-04-06 Thread Chris McDonough

You can run them by doing "python testCatalog.py -p"... some will fail due
to not having various files on the filesystem, but most should pass.

I haven't had time to actually even look at the bug in the bugreport.
Thanks for the possible fix to the bug that I don't understand yet, however!
;-)

- Original Message -
From: "Chris Withers" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; "Chris McDonough" [EMAIL PROTECTED]
Sent: Thursday, April 05, 2001 6:41 PM
Subject: [Zope-dev] ZCatalog FieldIndex Bug (Fix?)


 Chris Withers wrote:
  Correct me if I'm wrong, but if I query a field index with an empty
string, I
  expect to get returned all catalogued objects where that attribute's
value _is_
  the empty string.
 
  Anyway, this happens most of the time and I wish it happened all the
time.
  Basically, the only situation where this _doesn't_ happen is when _none_
of the
  objects catalogued in the field index have a value of the empty string,
which
  seems really bug and nasty to me ;-)

 I think I've got a solution, but I dunno if it's right. The patch is at
the end.
 How do I get the unit tests in ZCatalog/tests to run so I can check I
haven't
 screwed anything else up?

 cheers,

 Chris

 E:\Zope\2.3.1\lib\python\SearchIndexdiff -u unindex.py.old unindex.py
 --- unindex.py.old  Thu Apr 05 23:35:40 2001
 +++ unindex.py  Thu Apr 05 23:37:46 2001
 @@ -407,9 +407,9 @@

  if r is None:
  if anyTrue:
 -r=IISet()
 -else:
  return None
 +else:
 +r=IISet()

  return r, (id,)


 ___
 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] ZCatalog FieldIndex Bug (Fix?)

2001-04-06 Thread Chris Withers

Chris McDonough wrote:
 
 You can run them by doing "python testCatalog.py -p"... some will fail due
 to not having various files on the filesystem, but most should pass.

Ah... this doesn't work if you have Python 2.0 installed as your default python
and a Zope binary release ;-)
Zope needs python 1.5.2 ;-)

I got 8 fails before and 8 fails after applying the tests.

 I haven't had time to actually even look at the bug in the bugreport.
 Thanks for the possible fix to the bug that I don't understand yet, however!
 ;-)

Well, import the .zexp I attached earlier in this thread, and run the 'dotest'
Python Script.

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] ZCatalog FieldIndex Bug (Fix?)

2001-04-06 Thread Chris Withers

Chris McDonough wrote:
 
  Chris McDonough wrote:
  
   You can run them by doing "python testCatalog.py -p"... some will fail
 due
   to not having various files on the filesystem, but most should pass.
 
  Ah... this doesn't work if you have Python 2.0 installed as your default
 python
  and a Zope binary release ;-)
  Zope needs python 1.5.2 ;-)
 
 Thanks, professor.  ;-)

:-P

 Will do!  Thanks very much for tracking this down and sorry to not be more
 helpful in the process.

Pleasure, I wish I could have provided a unit test, but such is life ;-)

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 )



[Zope-dev] Re: [Zope-Annce] DBObjects 1.0 and Demos for Proiektor ZQuest released

2001-04-06 Thread Sherwood Robinson

That URL correct?

At 08:06 AM 4/5/2001 -0500, Stephan Richter wrote:
Hello everyone,

iuveno AG, Ingolstadt Germany, has made available a demo and products 
page, releasing several products:

THE LINK: http://demo.iuveno-net.de/

1. DBObjects 1.0 - DBObjects is a framework that maps relational data to a 
Zope object tree. It provides many features (such as SQL Method 
auto-generation) and saves up to 95% development time on object creation 
with relational data. API Documentation, a Demo, Feature List and so on 
are available on the site.

2. Proiektor - Proiektor is a groupware and project management system 
developed by iuveno. It is based on DBObjects and implements a nice set of 
features with some unique design ideas. But see yourself...

3. ZQuest - ZQuest was originally written for a university as testing tool 
and is now also developed by iuveno AG. It has a good set of features, 
especially for scientific questions. ZQuest uses DBObjects of course. If 
you are interested, click on the link above ...

4. CMS - Our Content Management System is coming soon with a true 
user-friendly management interface...

ALL THESE PRODUCTS ARE OPEN SOURCE!!! Please feel free to contact me any 
time via E-mail ([EMAIL PROTECTED] or [EMAIL PROTECTED]) or via phone at 
+1-901-230-ZOPE (9673).

I hope you enjoy!

Regards,
Stephan


--
Stephan Richter
CBU - Physics and Chemistry Student
Web2k - Web Design/Development  Technical Project Management


___
Zope-Announce maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-announce

  Zope-Announce for Announcements only - no discussions

(Related lists - Users: http://lists.zope.org/mailman/listinfo/zope
Developers: http://lists.zope.org/mailman/listinfo/zope-dev )



___
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] ZPatterns sub-Specialist traversal

2001-04-06 Thread Michael R. Bernstein

Ulrich Eck wrote:
 
  traversal_method has 'REQUEST, name' as parameters, and the
  following body:
 
  return getattr(container.Renderings, name)
 
  The 'traversal' SkinScript has the following body:
 
  WITH SELF COMPUTE __bobo_traverse__=traversal_method
 
 
 
 try:
 
 if len(traverse_subpath)  0:
 name = traverse_subpath[0]
 
 return getattr(container.Renderings,name)

Nope, same error.

What should I try next?

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 )



[Zope-dev] Bug in ZMI?

2001-04-06 Thread E. Seifert

Hi list,

I think I encountered a problem with the ZMI.
Everytime I added a new property to the memory cache object the list doesn't 
display them correctly.
They are concatenated; no space between them.

Is this a known bug?

Bye
Eric


___
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] Memory problems with ParsedXML ?

2001-04-06 Thread Karl Anderson

Godefroid Chapelle [EMAIL PROTECTED] writes:

 Karl Anderson a crit :

  Another thing to keep in mind is that the ParsedXML *product* is a DOM
  tree and a management interface around it.  The management interface
  only gives you a convenient UI and a place to store a few bits that
  the DOM doesn't know about (content type, namespace usage, etc.).
  It's always more efficient to just use the DOM tree and related
  utilities (parsing, printing), although it is less convenient - you
  have to know a little bit more about what you're doing.  Do you need
  each of those 2500 product instances?  See the createDOMDocument
  method to create a DOM document without the management interface.
 
 
 I am trying to use createDOMDocument, calling it from an external method:
 
 from Products.ParsedXML import ParsedXML
 
 def accessXml(document):
 return ParsedXML.createDOMDocument(document)
 
 When using the document returned in a python script,  it seems that Zope
 security prevents me from accessing any DOM attributes.
 
 Am I doing something wrong or am I forced to do everything through external
 methods ?

The DOM objects without the ParsedXML management proxies don't have
any Zope security information associated with them, so you have to
provide it yourself.  This is one of the things that the management
proxies provide.

I didn't mean to sell the proxies short; I should have mentioned that
you have to know about providing the features youself that they
provide, including security, so this is an area for Zope experts.
I've added this to the README.  Furthermore, if you're just calling
methods on the Document node, without traversing to its subnodes,
you're really not paying much of a price; you're basically just
putting more function calls between you and the DOM object until you
access a DOM subobject.

I don't use the python scripts much, but they have very restricted
security, being web-edited and all.  So yes, one way to give access is
to use external methods.  Another way is to use a python product and
the security machinery available to you there.

The unproxied DOM objects are similar to any non-Zope aware python
class instances with regards to security; if you're unfamiliar with
it, I'd play around with some non-Zope aware dummy class instances,
with nested subinstances and attributes, until you know how to make
those objects and attributes publishable.

-- 
Karl Anderson  [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] ZPatterns, DataSkins, forms and error checking/handling

2001-04-06 Thread ender

On Tuesday 27 March 2001 17:40, Itai Tavor wrote:
Hi,

I'm trying to work out the best way to check for and report errors
when DataSkin objects are created/edited, but I'm having a lot of
problems.

For form validation, Zope's build-in constraints are pretty
useless... things like ValueHandler are a little better, but IMO not
good enough. When a user types incorrect data in a form, I don't want
to display a page with a list of errors and say "click Back to fix
your errors". I want to return the form, with a list of errors and
the bad fields highlighted. So I need to perform field checks in the
form action method and in case of errors call the original form,
giving it an error list.

I know that to ensure that object data is always valid I should
validate the object in a SkinScript, using WHEN OBJECT ADDED,CHANGED
call self.validate(), and raise an exception in validate in case of a
problem. But this can't deal with returning the original form. It can
only display error pages, and to display nicely formatted error pages
it has to return a DTML Method so I can use dtml-raise, rather than
directly do raise in validate.

So I'm looking at a validate method for use at commit time, a
show_errors DTML Method, and a validate_form to call from the form
action method...

The validate_form method is defined in the DataSkin class. But it is
also used when a new object is created from a form, so it needs to be
called from a Specialist before the object is created, so I need to
import it in the Specialist. But this method might use other methods
of the DataSkin class, so I need to import those too...

So, to sum up, I need a method used in commit time, that renders a
DTML method to raise an error message, another method to verify form
submissions and return the form with error messages, and I need to
import that method and all other methods it uses into the Specialist.
This seems too much work...

Can anyone suggest a simpler approach (one that still retains the
ability to return the original form in case of errors)?

check out dtml-contract.

sample form processor with dtml contract

dtml-contract
this page retrieves records from the db based on user input
dtml-params
foo:int,optional
bar:date
foobar:range(int, 0,10)
dtml-exceptions
bad_user_input
/dtml-contract

user gets redirected if bar is not a valid date string, and foobar is not a 
integer compatible string between 0 and 10. if foo is present it must be a 
integer compatible string (compatible means coercible via int(foo)). if any 
of these things does not happen than all the collected errors for the page 
are sent to the error handler bad_user_input. this is not a redirect, the 
error handler is evaluated in the context of the page with an additonal value 
added to the namespace to denote the list of errors. page processing stops 
after evaluation of the tag if an error occurs.

this may be clear as mud, i don't know, i tried to make the included 
documentation pretty inclusive and readable, its not completely insync with 
the code but it does elaborate on the feature set pretty well. if you have 
specific questions feel free to ask.

so in your case you can just use the original form as the error handler and 
add logic to it to insert the values if they already exist in the request, 
and display error messages to the user on the particular vars that have 
problems based on the existence of the special error variable.

hth

kapil


TIA, Itai

___
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] Re: [ez] Re: [Zope-Annce] DBObjects 1.0 and Demos for Proiektor ZQuest released

2001-04-06 Thread Andreas Jung

This seems to have major problems. Several time during the day it was up and
down.
Such is life.

Andreas
- Original Message -
From: "Sherwood Robinson" [EMAIL PROTECTED]
To: "Stephan Richter" [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]; "EuroZope" [EMAIL PROTECTED]
Sent: Friday, April 06, 2001 12:01 PM
Subject: [ez] Re: [Zope-Annce] DBObjects 1.0 and Demos for Proiektor 
ZQuest released


 That URL correct?

 At 08:06 AM 4/5/2001 -0500, Stephan Richter wrote:
 Hello everyone,
 
 iuveno AG, Ingolstadt Germany, has made available a demo and products
 page, releasing several products:
 
 THE LINK: http://demo.iuveno-net.de/
 
 1. DBObjects 1.0 - DBObjects is a framework that maps relational data to
a
 Zope object tree. It provides many features (such as SQL Method
 auto-generation) and saves up to 95% development time on object creation
 with relational data. API Documentation, a Demo, Feature List and so on
 are available on the site.
 
 2. Proiektor - Proiektor is a groupware and project management system
 developed by iuveno. It is based on DBObjects and implements a nice set
of
 features with some unique design ideas. But see yourself...
 
 3. ZQuest - ZQuest was originally written for a university as testing
tool
 and is now also developed by iuveno AG. It has a good set of features,
 especially for scientific questions. ZQuest uses DBObjects of course. If
 you are interested, click on the link above ...
 
 4. CMS - Our Content Management System is coming soon with a true
 user-friendly management interface...
 
 ALL THESE PRODUCTS ARE OPEN SOURCE!!! Please feel free to contact me any
 time via E-mail ([EMAIL PROTECTED] or [EMAIL PROTECTED]) or via phone at
 +1-901-230-ZOPE (9673).
 
 I hope you enjoy!
 
 Regards,
 Stephan
 
 
 --
 Stephan Richter
 CBU - Physics and Chemistry Student
 Web2k - Web Design/Development  Technical Project Management
 
 
 ___
 Zope-Announce maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-announce
 
   Zope-Announce for Announcements only - no discussions
 
 (Related lists - Users: http://lists.zope.org/mailman/listinfo/zope
 Developers: http://lists.zope.org/mailman/listinfo/zope-dev )



 _
 EuroZope mailing list http://eurozope.beehive.de/
 [EMAIL PROTECTED]
 https://admin.comlounge.net/mailman/listinfo/eurozope



___
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] iuveno Products Page - DBObjects, Proiektor and ZQuest - FIXED

2001-04-06 Thread Stephan Richter

Okay,

I think the old version of our CMS system did not like the new Zope too 
much. I have taken this demo out of the site (since it was not available in 
anyway) and ran 'wget' extensively (I started 100 threads running a 
recursive wget). If you still experience difficulties, please let me know.

The Link again: http://demo.iuveno-net.de/

Regards,
Stephan

--
Stephan Richter
CBU - Physics and Chemistry Student
Web2k - Web Design/Development  Technical Project Management


___
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 FieldIndex Bug (Fix?)

2001-04-06 Thread Chris McDonough

 Chris McDonough wrote:
 
  You can run them by doing python testCatalog.py -p... some will fail
due
  to not having various files on the filesystem, but most should pass.

 Ah... this doesn't work if you have Python 2.0 installed as your default
python
 and a Zope binary release ;-)
 Zope needs python 1.5.2 ;-)

Thanks, professor.  ;-)

 I got 8 fails before and 8 fails after applying the tests.

Sounds good to me!!

  I haven't had time to actually even look at the bug in the bugreport.
  Thanks for the possible fix to the bug that I don't understand yet,
however!
  ;-)

 Well, import the .zexp I attached earlier in this thread, and run the
'dotest'
 Python Script.

Will do!  Thanks very much for tracking this down and sorry to not be more
helpful in the process.

- C



___
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] ZPatterns sub-Specialist traversal

2001-04-06 Thread Michael R. Bernstein

Hello all,

I've been trying to follow the instructions for getting
subSpecialist instances to appear as directly traversable
from Specialist instances, but have not yet had any success.

Here is what I've done:

ArchiveImages (Specialist)
 defaultRack
  traversal_method (Python Script)
  traversal (SkinScript)
 Renderings (sub-Specialist)
  defaultRack

traversal_method has 'REQUEST, name' as parameters, and the
following body:

return getattr(container.Renderings, name)

The 'traversal' SkinScript has the following body:

WITH SELF COMPUTE __bobo_traverse__=traversal_method


Nevertheless, when I try to traverse an instance in the
Specialist to an instance into the subspecialist, I get an
error:

http://localhost:8080/ArchiveImages/001/002

Resource not Found

Traceback (innermost last):
  File
/usr/local/zope/2-3-1/lib/python/ZPublisher/Publish.py, line
223, in publish_module
  File
/usr/local/zope/2-3-1/lib/python/ZPublisher/Publish.py, line
187, in publish
  File /usr/local/zope/2-3-0/lib/python/Zope/__init__.py,
line 221, in zpublisher_exception_hook
(Object: 001)
  File
/usr/local/zope/2-3-1/lib/python/ZPublisher/Publish.py, line
162, in publish
  File
/usr/local/zope/2-3-1/lib/python/ZPublisher/BaseRequest.py,
line 372, in traverse
  File
/usr/local/zope/2-3-1/lib/python/ZPublisher/HTTPResponse.py,
line 547, in notFoundError
NotFound: (see above)

The 002 sub-Specialist instance exists and is accessable
normally
(http://localhost:8080/ArchiveImages/Renderings/002), so I
must be doing something wrong in the PythonScript or the
SkinScript, but I don't know what.

Any help would be appreciated,

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 )