Re: [Zope] siblings of me, rather than of parent

2000-12-03 Thread Randall Kern



Sorry, my __bobo_traverse__ method is working, the 
PARENTS stack is exactly as I would hope, with my module as the parent of the 
category, rather than the root.
 
Here's the whole story:
 
/
    index_html    
(dtml method)
    index.html    
(dtml method)
    category (Folder)
foo.html    
(dtml method)
    blah    
(Module)
    category 
(Folder)
    
header.html    (dtml method)
    weather    
(Category)
 
/index_html:
    
 
/index.html:
    
 
        
        
    
 
    
        
    
 
    
 
 
Now, what I hope to happen is that the dtml-with 
would bind to the /blah/category folder, and therefore be able to find 
header.html.  However, somehow it's getting the /category folder instead, 
which doesn't have header.html.
 
Anyone understand why this is 
happening?
 
Thanks again,
-Randy

  - Original Message - 
  From: 
  Randall Kern 
  
  To: [EMAIL PROTECTED] 
  Sent: Sunday, December 03, 2000 8:08 
  PM
  Subject: [Zope] siblings of me, rather 
  than of parent
  
  My site has two main classes of objects, Modules 
  (and their derivatives), and Categories.  A normal setup might look 
  something like this:
   
  root
      blab    
  (Module)
      weather 
(Category)
      rain 
  (Category)
          sun 
  (Category)
      region (Category)
   
  I need to handle URLs like 
  /root/blab/weather.  The problem is that I need weather.__of__(blab) on 
  the stack, rather than weather.__of__(root) on top.  This is because blab 
  (in some cases) overrides default behaviors from root.
   
  I thought the proper way to do this was by adding 
  a __bobo_traverse__ method to my Module, like this:
   
     def __bobo_traverse__(self, REQUEST, 
  name):    
  try:    
  parents = 
  REQUEST['PARENTS']    
  parent = 
  parents[-2]    
  if hasattr(parent, 
  name):    
  ob = getattr(parent, 
  name)    
  if ob.meta_type == 
  'Category':    
  return ob.aq_inner.__of__(self)    
  except:    
  pass
   
      return 
  getattr(self, name)
   
  But that doesn't seem to change anything, 
  although it does perform the return (and doesn't throw any 
  exceptions.)
   
  Basically, I'm trying to offer my siblings as if 
  they were my children, so if they fail to offer something, it will be looked 
  for in me, rather than my parent.
   
  Thanks,
  -Randy


[Zope] REQUEST.set('n', n+1) broken on zope.org

2000-12-03 Thread Richard Jones

As the subject says, REQUEST.set('n', n+1) is broken on zope.org. The
following DTML will raise an AttributeError on __add__:




Is this a permanent change and is this going into the Zope codebase?


Richard

-- 
Richard Jones
[EMAIL PROTECTED]
Senior Software Developer, Bizar Software
www.bizarsoftware.com.au

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




Re: [Zope] dtml methods and properties

2000-12-03 Thread Chris Gray

On Mon, 4 Dec 2000, Willem Broekema wrote:

> As a DTML method is said to work with the properties of the object it
> is called at:
> 
> DTML method "m":
>  
> 
> /m 
>  displays the date/time when the last change happened to any file
>  in the root folder

This _is_ the folder's bobobase_modification_time you're getting. A folder
is largely a container.  Aside from creating or deleting it you can only
change it by changing what it contains.  Changing a folder's properties or
deleting a file it contains also updates it's bbb_mod_time.
 
> /m/m
>  displays last change date/time of method m

By calling m/m you've bound m as the client object for the method
m.   will give you m's id,  will give you m's
title.  DTML Methods are designed to give you access to the attributes of
the object they are called on.

> Why does the method not display it's modification time on the first
> occasion? Or: why does it not give the folder's modification time
> on the second occasion?

If you make m a DTML Document it will give it's own bbb_mod_time no matter
how you call it.


Cheers,
Chris




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




[Zope] Tag attributes...

2000-12-03 Thread Curtis Maloney


Green things,

I've written a handy tag for my Zope site, and it accepts a few attributes.  
This is all going well, and the tag is working nicely. (Even though I 
couldn't seem to find any docs on doing this, I just fumbled about with the 
source from the sendmail tag)

However, it seems there is no way to determine if an attribute is a quoted 
string, or just a variable name, and the only solution is to provide 
different attributes depending on how this information is passed.

Have I missed something, or is there some hidden feature of 'parse_params' 
that I'm missing?

Have a better one,
Curtis Maloney.

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




[Zope] newbie question -- database list/report with sort by column header

2000-12-03 Thread John Cappelletti


I am listing the results of a database query using dtml-in. I'd like to
be able to give the user the option to re-sort the list by clicking on a
column header. ok... I'm starting small with a form and radio buttons to
allow the user to specify the sort.

I've created what I believe to be a global variable for this page using
the property screen. The variable is to capture the column name for the
sort. My simple question is how do I assign a value to this variable
inside of the dtml method! I'm not finding a description of variable
assignment in the documentation (yeah, I must be missing the obvious).

Any pointers would be appreciated.  (also, know if anyone has
implemented interactive sort by column header?)

thanks,
John Cappelletti
  AverStar, Inc.
  1593 Spring Hill Road, Suite 700
  Vienna, VA 22182-2249
  Tel: (703) 827-2606 x 4291 (also, 301 443-7509)
  Fax: (703) 827-5560



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




[Zope] dynpersist.dll for ZPatterns

2000-12-03 Thread Ot Ratsaphong

Hi,

I am new to Zope (<1 week old) and have installed Zope 2.2.4 on my Win98 PC.

I am interested in learning about the Object-Oriented capabilities of Zope
and am interested in installing ZPatterns. Unfortunately I do not have MSVC
6.0 installed on my PC 8^(. Subsequently I cannot built dynpersist.dll.

I am wondering whether someone could help me out and send me a copy of the
above dll. I have installed Zope 2.2.4 in C:\Zope.

I would much appreciate any assistance in this matter.

Thanks in Advance
Ot Ratsaphong
Canberra, Australia



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




[Zope] confusing access error

2000-12-03 Thread Matthew Wilbert

I am getting an access error I don't understand at all,
which makes me think I have some basic conceptual problem
which I hope you can help me get past.  I have never used
ZopeFind before, so that may be part of it.

I have a DTML method that looks like this:



  
  



I actually want to put something in the , and
add some additional parameters to the find, but just trying
to execute the method as written I get the following Zope error.

Zope Error
Zope has encountered an error while publishing this resource.
Unauthorized<
 
You are not authorized to access title_or_id.

Traceback (innermost last):
  File C:\PROGRA~1\test\lib\python\ZPublisher\Publish.py, line 222, in publish_module
  File C:\PROGRA~1\test\lib\python\ZPublisher\Publish.py, line 187, in publish
  File C:\PROGRA~1\test\lib\python\ZPublisher\Publish.py, line 171, in publish
  File C:\PROGRA~1\test\lib\python\ZPublisher\mapply.py, line 160, in mapply
(Object: testit)
  File C:\PROGRA~1\test\lib\python\ZPublisher\Publish.py, line 112, in call_object
(Object: testit)
  File C:\PROGRA~1\test\lib\python\OFS\DTMLMethod.py, line 167, in __call__
(Object: testit)
  File C:\PROGRA~1\test\lib\python\DocumentTemplate\DT_String.py, line 502, in __call__
(Object: testit)
  File C:\PROGRA~1\test\lib\python\DocumentTemplate\DT_In.py, line 691, in renderwob
(Object: ZopeFind(this()))
  File C:\PROGRA~1\test\lib\python\DocumentTemplate\DT_With.py, line 132, in render
(Object: sequence-item)
  File C:\PROGRA~1\test\lib\python\OFS\DTMLMethod.py, line 163, in __call__
(Object: addEventToResource)
  File C:\PROGRA~1\test\lib\python\DocumentTemplate\DT_String.py, line 502, in __call__
(Object: addEventToResource)
  File C:\PROGRA~1\test\lib\python\OFS\DTMLMethod.py, line 163, in __call__
(Object: standard_html_header)
  File C:\PROGRA~1\test\lib\python\DocumentTemplate\DT_String.py, line 502, in __call__
(Object: standard_html_header)
  File C:\PROGRA~1\test\lib\python\OFS\DTMLMethod.py, line 189, in validate
(Object: testit)
  File C:\PROGRA~1\test\lib\python\AccessControl\SecurityManager.py, line 139, in 
validate
  File C:\PROGRA~1\test\lib\python\AccessControl\ZopeSecurityPolicy.py, line 209, in 
validate
Unauthorized: (see above)

If I replace the  with 
 or , I get no error, and if I 
display them I see the right thing.

There is only the root acl_users folder around, and it has only one user set up with 
manage priv's for pretty much everything.  That user can do anything I have tried 
except run this DTML method.  When I try to run the method, I get
prompted several times for a username/password--clearly it doesn't want to accept that 
user's authorization.

If anyone could explain why this is happening, and how I can
make it stop, that would be very helpful.

Thanks very much,

Matt Wilbert
[EMAIL PROTECTED]
___
Visit http://www.visto.com/info, your free web-based communications center.
Visto.com. Life on the Dot.


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




[Zope] siblings of me, rather than of parent

2000-12-03 Thread Randall Kern



My site has two main classes of objects, Modules 
(and their derivatives), and Categories.  A normal setup might look 
something like this:
 
root
    blab    
(Module)
    weather (Category)
    rain 
(Category)
        sun 
(Category)
    region (Category)
 
I need to handle URLs like 
/root/blab/weather.  The problem is that I need weather.__of__(blab) on the 
stack, rather than weather.__of__(root) on top.  This is because blab (in 
some cases) overrides default behaviors from root.
 
I thought the proper way to do this was by adding a 
__bobo_traverse__ method to my Module, like this:
 
   def __bobo_traverse__(self, REQUEST, 
name):    
try:    
parents = 
REQUEST['PARENTS']    
parent = 
parents[-2]    
if hasattr(parent, 
name):    
ob = getattr(parent, 
name)    
if ob.meta_type == 
'Category':    
return ob.aq_inner.__of__(self)    
except:    
pass
 
    return 
getattr(self, name)
 
But that doesn't seem to change anything, although 
it does perform the return (and doesn't throw any exceptions.)
 
Basically, I'm trying to offer my siblings as if 
they were my children, so if they fail to offer something, it will be looked for 
in me, rather than my parent.
 
Thanks,
-Randy


[Zope] dtml methods and properties

2000-12-03 Thread Willem Broekema

As a DTML method is said to work with the properties of the object it
is called at:

DTML method "m":
 

/m 
 displays the date/time when the last change happened to any file
 in the root folder

/m/m
 displays last change date/time of method m

Why does the method not display it's modification time on the first
occasion? Or: why does it not give the folder's modification time
on the second occasion?

- Willem

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




Re: [Zope] Wampum generator on Zope 2.2.4 fails / _isBeingUsedAsAMethod

2000-12-03 Thread Steve Spicklemire


Hmm.. I *know* I've seen this before. I think it was when I was trying
to move ZClasses that were *created* under Zope 2.2.0+ to Zope 2.1.x.
Are you sure you're working with 100% 2.2.4?

-steve

> "Brad" == Brad Clements <[EMAIL PROTECTED]> writes:

Brad> Selecting the Security Tab on a Wampum Generator produces
Brad> this output:

Brad> Error Type: AttributeError Error Value:
Brad> _isBeingUsedAsAMethod


Brad> Traceback (innermost last): File
Brad> /usr/holmes/Zope/lib/python/ZPublisher/Publish.py, line 222,
Brad> in publish_module File
Brad> /usr/holmes/Zope/lib/python/ZPublisher/Publish.py, line 187,
Brad> in publish File
Brad> /usr/holmes/Zope/lib/python/Zope/__init__.py, line 221, in
Brad> zpublisher_exception_hook (Object: CyberCash) File
Brad> /usr/holmes/Zope/lib/python/ZPublisher/Publish.py, line 171,
Brad> in publish File
Brad> /usr/holmes/Zope/lib/python/ZPublisher/mapply.py, line 160,
Brad> in mapply (Object: manage_access) File
Brad> /usr/holmes/Zope/lib/python/ZPublisher/Publish.py, line 112,
Brad> in call_object (Object: manage_access) File
Brad> /usr/holmes/Zope/lib/python/AccessControl/Role.py, line 252,
Brad> in manage_access (Object: Traversable) AttributeError: (see
Brad> above)


Brad> Any ideas?

Brad> Brad Clements, [EMAIL PROTECTED] (315)268-1000
Brad> http://www.murkworks.com (315)268-9812 Fax netmeeting:
Brad> ils://ils.murkworks.com AOL-IM: BKClements

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


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




Re: [Zope] Public CVS Zope won't compile (fwd)

2000-12-03 Thread Michel Pelletier



On Sun, 3 Dec 2000, Chris Gray wrote:

> Did a fresh checkout but "python w_pcgi.py" chokes at:
> 
> Writing the pcgi resource file (ie cgi script),
> /home/cpgray/zope_cvs_run/Zope2/Zope.cgi
> chmod 0755 /home/cpgray/zope_cvs_run/Zope2/Zope.cgi
> Traceback (innermost last):
>   File "w_pcgi.py", line 111, in ?
> if __name__=='__main__': main(sys.argv[0])
>   File "w_pcgi.py", line 109, in main
> import wo_pcgi; wo_pcgi.main(me)
>   File "/home/cpgray/zope_cvs_run/Zope2/wo_pcgi.py", line 98
> import comcontent.main(home, user, group)
>   ^
> SyntaxError: invalid syntax
> 
> Cheers and Beers,
> Chris

Works dandy here, neither w_pcgi.py or wo_pcgi.py have been modified in
over a year.  I agree that the code your traceback reports on line 98 is a
syntax error, but it doesn't match what is on line 98 in the CVS.

-Michel



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




[Zope] Can't load confirm message box

2000-12-03 Thread Angietel