[Zope-dev] Problem by counting the number of result of database query

2000-07-29 Thread Bruno Nana

 Hi,

 I have one problem with a Zmethod.

 Here is the method:

 select *,summe=sum(count(*))
 from neuigkeiten
 where
 (
 username like '%!--#var suche--%' or
 autorloginname like '%!--#var suche--%' or
 headline like '%!--#var suche--%' or
 textfeld like '%!--#var suche--%')
 order by headline

 That is i want to select some data from database and save the number
of data
 who are found in summe.(Number found:dtml-var  summe is ok)
 There is no error at this level, but there is a problem when i list
the
 result in the dtml document. There are more data as i need.

 Please would you help me to resolv this problem!!

 Thank

 Bruno



___
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] MethodGeddon

2000-07-29 Thread Chris Withers

http://www.zope.org/Wikis/zope-dev/MethodGeddon

Just been reading about this and I was wondering how is coming along...

Is it in the fishbowl under another name or should it be in the
fishbowl?

Shane, would the argument list be a management tab for methods?
That sounds cool to me :-)

I reckon 'self' should always be the equivalent of the python 'self' or
not exist to avoid confusion. I guess that means it wouldn't get used
much since it would be the actual method-object (and I thought that was
an oxymoron ;-) but with the possibility opf things like __render__ and
__call__, who knows...

The argument list would be great, 'cos you could then be able to specify
additional arguments of type 'binding' which might be any of the
following from you list: (select by dropdown? ;-)

 Bind to the object containing a method,

 Bind to the object that acquired a method, and possibly

 Bind to the object containing the method in the context of the object that acquired 
the method, and maybe even

 When a method is defined in a ZClass, bind to the instance in such a way that 
attribute lookup is performed in the baseclasses of the class defining the method 
(aka bind to "super").

So you could get to any or all of those as you need in your method. Of
course, new users wouldn't have to worry about this until they needed to
do something that used it.

The other option would be to have these automatically bound to certain
names (like _ is now) but perhaps that would be more confusing?

Thoughts and comments would be great :-)

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] AcquisitionMadness

2000-07-29 Thread Chris Withers

Evan,

I wonder if the changes Shane suggested in MethodGeddon would make
Simplified Acquistion suffice for what Steve was asking about?

Also can you explain how from the example:
Two path acquisition: A contains B1 and C1, B1 contains B2, C1 contains
C2

How (Natural Acquisition):
A.B1.B2.C1 == (((C1 o A) o (B1 o A)) o ((B2 o B1) o (B1 o A)))

equates to:
"Roughly speaking, search the objects in the reverse of the order they
were mentioned in, along the shortest physical path between each
object."

and how it differs in effect from:

A.B1.B2.C1 == (((C1 o A) o (B1 o A)) o (B2 o (B1 o A)))

(which is what I think simplified Acquisition would return...)

cheers,

Chris

PS: This might just be explaining how the (x o y) notation actually
tells you where the object's attribute comes from :S
(in the above example, how, in each case, the notation explains where C1
comes from...)

PPS: What's happening with the Zope-Dev Wiki? Is it being fazed out?

___
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] Renaming ZClass instances in 2.2.0

2000-07-29 Thread Steve Alexander

In Zope 2.2.0, I can't rename ZClass instances.

When you rename something, lib/python/OFS/CopySupport.py's
_verifyObjectPaste() method gets called with the object you're renaming
as an argument. The method checks that the current user is authorized to
create objects of that kind, and that the current user is authorized to
create that object in the current context.


The problem seems to be that, in the case of renmaing a ZClass instance,
when the ZopeSecurityPolicy tries to get a __roles__ attribute for the
instance you're renaming, it can't find one.

I'm way out of my depth here, but I can get it to work again by adding
to the function PersistentClassDict() in lib/python/ZClasses/ZClass.py
(line 195 or so):

dict['__roles__']=('Manager',)

so that it looks like this:


def PersistentClassDict(doc=None, meta_type=None):
# Build new class dict
dict={}
dict.update(Template.__dict__)
if meta_type is not None:
dict['meta_type']=dict['__doc__']=meta_type
if doc is not None:
dict['__doc__']=doc
dict['__roles__']=('Manager',)
return dict

This only works for ZClasses defined after the change, though.

I have absolutely no idea what the side-effects of this change are, and
I'm not even entirely sure what it does :-)

It seems to fix the problems of renaming DataSkin-derived ZClasses too.


I've looked though the recent CVS checkins, and I can't see a fix for
this yet. I've also looked through the Collector, and I can't see this
problem reported.

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