[Zope-dev] Simulate DTML-Method Proxy-Roles for python-product-methods ?

2000-11-15 Thread Martin Grönemeyer

Hello.

I've started to implement a small Product in Python. One method should be
able to access an object in a folder which isn't accessible by anonymous
but only by a special role. Is it possible to give a proxy-role to the
python-method to access this object ?

cheers Martin

i.A.
Martin Grönemeyer
Technik

|| | ||  c o m.u n i t   G m b H  ||| | | ||  |  | |   |  | | |   |

http://www.comunit.de/  mailto:[EMAIL PROTECTED]
Eiffestr. 598   20537 Hamburg | Germany
Fon +49 +40 | 21 11 05 25   Fax  +49 +40 | 21 11 05 26


___
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] Question: How can instatiate a Zclass from python.

2000-11-03 Thread Martin Grönemeyer

At 13:30 02.11.00 +0200, you wrote:
I am creating an external method in python and I want to add a product (in
that method) which is a Zclass (only, it doesn't exists in the
lib/python/Products directory). How can I instatiate this object and how
can I overide the name error that will occur (because I haven't import
anything)?


I think for a quick work'a'round you could use this snippet. If you are
using an external method pass the self explizitly to your method, e.g.
dtml-call "getNewZClass(this(),otherParameter)". In your method you have
to define the self as first argument.

self.aq_acquire('Control_Panel').Products.NameOfYourZClassProduct.NameOfYour
ZClass(Instance-Parameter)

Good luck.
i.A.
Martin Grönemeyer
Technik

|| | ||  c o m.u n i t   G m b H  ||| | | ||  |  | |   |  | | |   |

http://www.comunit.de/  mailto:[EMAIL PROTECTED]
Eiffestr. 598   20537 Hamburg | Germany
Fon +49 +40 | 21 11 05 25   Fax  +49 +40 | 21 11 05 26


___
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] Namespace trouble

2000-09-28 Thread Martin Grönemeyer

Hello everyone,

if've had little namespace problems with this code-snipped (dtml-method):

dtml-with REQUEST
 dtml-in "[1,2,3,4,5,6,7,8]"
  dtml-call "REQUEST.set('row_index',_['sequence-index'])"
  dtml-var "REQUEST.get('row_index')"
  dtml-var row_index
 /dtml-in
/dtml-with

This produces an output like this: 0,0,0,0,0,0,... The zero is the first
index set by REQUEST.set... The running index isn't reflected into the
current namespace. Why not ? It know it depends on dtml-with REQUEST, but
it didn't find an answer.

Thanks for any comment,

martin



___
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] Nameconflict 'Property' and Object in Folder

2000-07-25 Thread Martin Grönemeyer

Hi all,

has there some discussions about a name conflict, if I start to add an
object to a folder with an object-id wich is also a Property of the folder ?

In the method _checkId of the ObjectManager e.g. the folder is checked with
hasatrr(this,id). And this is true if there exists a property with the same
name as the object-id. I see no workaround, because a property or an object
are attributs of the folder.

Any comments ?

Martin


___
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] SiteAccess smashes 'REQUEST.resolve_url(...)' in DTML ?

2000-05-19 Thread Martin Grönemeyer

 i have some strange problmes by using the
 "REQUEST.resolve_url('http://mydomain/...')" in DTML if SiteAccess is
 active. I have also some Sites in use without SiteAccess and no problems
 with the above method.

Tell me more about the problem, please.  SiteAccess replaces
REQUEST.traverse, which is called by REQUEST.resolve_url.  Are you just
using resolve_url to grab objects given their path?


Getting an object-Context (index_html = DTML Document) by absolute URL:

dtml-with "REQUEST.resolve_url('http://mydomain/home/index_html')"
dtml-var title
/dtml-with

throws

Error Type: ValueError
Error Value: Different namespace.


If i try to get an object-context of an unexisting object, the snippet
above throws the correct message that the ressource wasn't found.

On a zope-installation (2.2alpha und 2.1.2) without SiteAccess this example
works fine.




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