Re: Re[2]: [Zope3-dev] Heads up: bugs in zope.app.catalog?

2006-11-17 Thread Dieter Maurer
Adam Groszer wrote at 2006-11-17 13:13 +0100: >What is the `good` behaviour regarding None values? >Do we need to catalog them or skip them? If you index them, you rely on a non garanteed implementation artefact: Python explicitly does not garanteed that comparisons between objects of differe

Re: [Zope3-dev] Re: RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Gary Poster
On Nov 17, 2006, at 1:46 PM, Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gary Poster wrote: On Nov 17, 2006, at 10:23 AM, Adam Groszer wrote: Hello, Solutions: a: No, do not keep None values in the catalog the current implementation works like this you are unabl

[Zope3-dev] Re: RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gary Poster wrote: > On Nov 17, 2006, at 10:23 AM, Adam Groszer wrote: > >> Hello, >> >> Solutions: >> >> a: No, do not keep None values in the catalog >>the current implementation works like this >>you are unable to ask the catalog for object

Re: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Gary Poster
On Nov 17, 2006, at 11:44 AM, Christian Theune wrote: Gary Poster wrote: Yeah, it makes me a little nervous too. I'm comfortable saying this should go on the trunk, but I'd default to saying that it shouldn't be backported, unless there's a groundswell of support. Splitting up the patch int

Re: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Christian Theune
Gary Poster wrote: > Yeah, it makes me a little nervous too. I'm comfortable saying this > should go on the trunk, but I'd default to saying that it shouldn't > be backported, unless there's a groundswell of support. Splitting up the patch into a bug fix and a feature doesn't make any sense,

Re: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Gary Poster
On Nov 17, 2006, at 11:38 AM, Christian Theune wrote: Gary Poster wrote: On Nov 17, 2006, at 11:29 AM, Adam Groszer wrote: I propose to remove the try/except. Is that OK? Yes, I think removing the bare try...except is definitely the right thing to do. (Anyone care to disagree?) Would t

Re: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Christian Theune
Gary Poster wrote: > On Nov 17, 2006, at 11:29 AM, Adam Groszer wrote: > >> Hello Gary, >> >> At the moment it is >> try: >> value = value() >> except: >> return None >> >> So that will eat the exception without any signs. >> That makes me also glum when I have to dig deep to discover th

Re: Re[5]: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Gary Poster
On Nov 17, 2006, at 11:29 AM, Adam Groszer wrote: Hello Gary, At the moment it is try: value = value() except: return None So that will eat the exception without any signs. That makes me also glum when I have to dig deep to discover that something ate an exception. I propose to remov

Re[5]: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Adam Groszer
Hello Gary, At the moment it is try: value = value() except: return None So that will eat the exception without any signs. That makes me also glum when I have to dig deep to discover that something ate an exception. I propose to remove the try/except. Is that OK? Friday, November 17, 20

Re: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Christian Theune
Gary Poster wrote: > On Nov 17, 2006, at 11:13 AM, Adam Groszer wrote: >> >> Two more questions remain open, but I think they are easy to answer. >> >> In case the field is callable but the method to be called is None > > Yes, remove from index. Same behaviour as for a None value, so remove from

Re: Re[3]: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Gary Poster
On Nov 17, 2006, at 11:13 AM, Adam Groszer wrote: Hello, Two more questions remain open, but I think they are easy to answer. In case the field is callable but the method to be called is None Yes, remove from index. OR The method is not None but raises an exception while getting the value

Re[3]: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Adam Groszer
Hello, Two more questions remain open, but I think they are easy to answer. In case the field is callable but the method to be called is None OR The method is not None but raises an exception while getting the value In both cases the previous value should be removed from the index? I think yes.

Re[2]: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Adam Groszer
Hello Gary, OK, my mistake. Then I'll do like a). Friday, November 17, 2006, 4:46:09 PM, you wrote: GP> On Nov 17, 2006, at 10:23 AM, Adam Groszer wrote: >> Hello, >> >> Solutions: >> >> a: No, do not keep None values in the catalog >>the current implementation works like this >>you are

Re: [Zope3-dev] z3c.widget.flashupload and compression? [bit OT]

2006-11-17 Thread Christian Theune
Hi, Adam Groszer wrote: > Hello Christian, > > Meanwhile Manfred dropped me an answer: > >> From my perspective there is now way for implementing an compression >> inside the widget because it is built in Flash / Actionscript and for >> security issues, you are not allowed to access the file

Re: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Gary Poster
On Nov 17, 2006, at 10:46 AM, Gary Poster wrote: This is a less efficient approach than the zc.catalog approach. Clarification: Less efficient from a data storage perspective. From a search perspective, it is more efficient. Gary ___ Zope3-de

Re[2]: [Zope3-dev] z3c.widget.flashupload and compression? [bit OT]

2006-11-17 Thread Adam Groszer
Hello Christian, Meanwhile Manfred dropped me an answer: > From my perspective there is now way for implementing an compression > inside the widget because it is built in Flash / Actionscript and for > security issues, you are not allowed to access the file on the > filesystem. You only get

Re: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Gary Poster
On Nov 17, 2006, at 10:23 AM, Adam Groszer wrote: Hello, Solutions: a: No, do not keep None values in the catalog the current implementation works like this you are unable to ask the catalog for objects having None properties b: Yes, keep None values in the catalog you can ask the

[Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Adam Groszer
Hello, Solutions: a: No, do not keep None values in the catalog the current implementation works like this you are unable to ask the catalog for objects having None properties b: Yes, keep None values in the catalog you can ask the catalog for objects having None properties c: Let's k

Re: [Zope3-dev] Heads up: bugs in zope.app.catalog?

2006-11-17 Thread Gary Poster
On Nov 17, 2006, at 7:22 AM, Christian Theune wrote: Hi, Adam Groszer wrote: Hello Christian, Yep, but... What is the `good` behaviour regarding None values? Do we need to catalog them or skip them? Example: If the object is (user.title == None) Shall it be kept in the catalog or not? In ca

Re[2]: [Zope3-dev] Heads up: bugs in zope.app.catalog?

2006-11-17 Thread Adam Groszer
Hello Christian, Yep, I also vote for indexing None. Seems like somebody wanted to avoid the `None object is not callable` exception. Friday, November 17, 2006, 1:22:42 PM, you wrote: > Hi, > Adam Groszer wrote: >> Hello Christian, >> >> Yep, but... >> What is the `good` behaviour regarding No

[Zope3-dev] Re: adapter registration question

2006-11-17 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris Withers wrote: > Tres Seaver wrote: >> We were discussion a (notional) "value adapter", whose factory would >> have the contract of returning an object of a specific concrete type, >> rather than on implementing an interface. > > Right, but the

[Zope3-dev] Re: strange behavior of intid-utility

2006-11-17 Thread Tom Gross
Here is the traceback: Error in test test_withoutintids (myproduct.ftests.test_wf.WorkflowTestCase) Traceback (most recent call last): File "/usr/lib/python2.4/unittest.py", line 260, in run testMethod() File "/mnt/zope/ldev/var/zope/lib/python/myproduct/ftests.py", line 20, in test_without

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-17 Thread Philipp von Weitershausen
Chris Withers wrote: Philipp von Weitershausen wrote: Chris Withers wrote: Can a named adapter find out the name it was registered with during the adaptation process? Nope. I can see why it's that way, but it seems a shame and maybe even an oversight :-/ What do you suggest I do when the

[Zope3-dev] Re: strange behavior of intid-utility

2006-11-17 Thread Philipp von Weitershausen
Tom Gross wrote: I have a site with some utilities. One is a zope.app.intid.UniqueIdUtility, which seems to be the cause of the problem (see the test). A NotYet-Exception is raised, when I try to add a zope.app.workflow.StatefulProcessDefinition-object to the container with the utilities. I

Re: [Zope3-dev] Re: wading through zcml...

2006-11-17 Thread Philipp von Weitershausen
Chris Withers wrote: Philipp von Weitershausen wrote: browser:view Note: browser:view always creates new classes on the fly. evil browser:page Registers an adapter where the second adapted object defaults to IBrowserDefaltLayer. Always creates a new class on the fly and mixes in func

Re: [Zope3-dev] Heads up: bugs in zope.app.catalog?

2006-11-17 Thread Christian Theune
Hi, Adam Groszer wrote: > Hello Christian, > > Yep, but... > What is the `good` behaviour regarding None values? > Do we need to catalog them or skip them? > > Example: > If the object is (user.title == None) > Shall it be kept in the catalog or not? > In case it is not in the catalog I won't be

Re[2]: [Zope3-dev] Heads up: bugs in zope.app.catalog?

2006-11-17 Thread Adam Groszer
Hello Christian, Yep, but... What is the `good` behaviour regarding None values? Do we need to catalog them or skip them? Example: If the object is (user.title == None) Shall it be kept in the catalog or not? In case it is not in the catalog I won't be able to search for users with no title. Sugg

Re: [Zope3-dev] z3c.widget.flashupload and compression? [bit OT]

2006-11-17 Thread Christian Theune
Hi, Adam Groszer wrote: > Hello, > > I'm a little bit offtopic with my question here. > > We had here the idea to implement a compression algorhitm in the above > package to save some precious upload bandwith. > > I'm not a flash professional, google did not spit out straightforward > solutions

Re: [Zope3-dev] Heads up: bugs in zope.app.catalog?

2006-11-17 Thread Christian Theune
Hi Adam, Adam Groszer wrote: > Working on them. That's great! I'd be happy to see your checkins then. It would be good if you took the time to backport this to 3.3 and 3.2 branches. Christian -- gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany www.gocept.com - [EMAIL PROTE

Re[2]: [Zope3-dev] Heads up: bugs in zope.app.catalog?

2006-11-17 Thread Adam Groszer
Hello Christian, Working on them. Friday, November 17, 2006, 12:39:37 PM, you wrote: > Got any tests? -- Best regards, Adammailto:[EMAIL PROTECTED] -- Quote of the day: He became what we are that He might make us what He is. - Athanasius (speaking of Jesus of N

Re: [Zope3-dev] Heads up: bugs in zope.app.catalog?

2006-11-17 Thread Christian Theune
Hi, Adam Groszer wrote: > Hello, > > I found that z.a.catalog, AttributeIndex fails to remove the previous > value/object from the index IF the new value is None. > > The next thing is if the index contains the object, but the value > somehow dropped out of the forward index, the unindex breaks.

[Zope3-dev] Heads up: bugs in zope.app.catalog?

2006-11-17 Thread Adam Groszer
Hello, I found that z.a.catalog, AttributeIndex fails to remove the previous value/object from the index IF the new value is None. The next thing is if the index contains the object, but the value somehow dropped out of the forward index, the unindex breaks. Anybody noticed these already? I have

Re: [Zope3-dev] Re: wading through zcml...

2006-11-17 Thread Chris Withers
Philipp von Weitershausen wrote: browser:view Note: browser:view always creates new classes on the fly. evil browser:page Registers an adapter where the second adapted object defaults to IBrowserDefaltLayer. Always creates a new class on the fly and mixes in functionality that makes t

Re: [Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-17 Thread Chris Withers
Philipp von Weitershausen wrote: Chris Withers wrote: Can a named adapter find out the name it was registered with during the adaptation process? Nope. I can see why it's that way, but it seems a shame and maybe even an oversight :-/ What do you suggest I do when the adapter needs to know

Re: [Zope3-dev] Re: adapter registration question

2006-11-17 Thread Chris Withers
Dieter Maurer wrote: As Chris example demonstrates, it would have been better to call "IZopeDublinCore(myobj)" the "IZopeDublinCore" adaptation of "myobj". Agreed, and would have saved me a lot of confusion. cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting

[Zope3-dev] Re: adapter registration question

2006-11-17 Thread Chris Withers
Tres Seaver wrote: We were discussion a (notional) "value adapter", whose factory would have the contract of returning an object of a specific concrete type, rather than on implementing an interface. Right, but the CA supports the use of classes instead of interfaces and that works just fine h

[Zope3-dev] Re: strange behavior of intid-utility

2006-11-17 Thread Tom Gross
Hi Philipp, I have a site with some utilities. One is a zope.app.intid.UniqueIdUtility, which seems to be the cause of the problem (see the test). A NotYet-Exception is raised, when I try to add a zope.app.workflow.StatefulProcessDefinition-object to the container with the utilities. I can