[Zope] Re: [Zope]Newbie: manage_changeProperties and wrong permission

2000-12-20 Thread Milos Prudek

Sven Hohage wrote:
> 
> Hallo Milos,
> I'm not sure if I understand your problem right.
> First of all what do you mean with 'Fir-class'?Is it a ZClass or a
> usual Zope-Folder.I suppose a Zope-Folder!.

Oh no. "Fir" is a Product, with a single Z Class "Fir". Within Fir there
are two folders and three methods:

Products
+-- Fir   (product)
+Fir  (Z Class)
+--cz (folder)
+lst_name (property of cz folder)
+lst_text (property of cz folder)
+--en (folder)
+lst_name (property of cz folder)
+lst_text (property of cz folder)
+--changeLST_form (method)
+--changeLST  (method)
+--display(method)

> You have to call the method "manage_changeProperties" on an Object.

An object in my case is a property "lst_name" in "cz" folder.

After creating an instance called AAA of Fir ZClass, I can access the
"display" method:

http://.AAA/cz/display

The "display" method simply contains just . Depending
on the URL, it displays the "cz/lst_name" or "en/lst_name".

Using the same acquisition thinking, the "changeLST" method contains 

where "lst_name_new" is obtained from a trivial form. I thought that
"changeLST" would change the "cz/lst_name" property when called with
http://.AAA/cz/changeLST.


> This should work: expr="cz.manage_changeProperties({'lst_name':lst_name_new})">

Unfortunately this would require to write many almost identical
changeLST methods: one with cz.manage_changeProperties, one with
en.manage_changeProperties, and there are many more language versions.

As you may have guessed this is a database where every record contains
many identical fields (name, text, etc.) for many languages. Like this:

+--cz
+lst_name
+lst_text
+--en
+lst_name
+lst_text
+--de
+lst_name
+lst_text
+--ru
+lst_name
+lst_text

The idea is that once a new user selects her preferred language (and a
Cookie is set for her), she is transferred to a starting url
"http://www.website.org/de/start.htm" and from there she can access the
database in her language by simple acquisition, without the need for
having each method in many "language" versions, like I said above.

I may figured it wrong. Is there a more clever way to do this?

--
Milos Prudek

___
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] RE: [Zope]Newbie: manage_changeProperties and wrong permission

2000-12-20 Thread Sven Hohage

Hallo Milos,
I'm not sure if I understand your problem right.
First of all what do you mean with 'Fir-class'?Is it a ZClass or a
usual Zope-Folder.I suppose a Zope-Folder!.
You have to call the method "manage_changeProperties" on an Object.
You find in the Zope Quick reference:
-
manage_changeProperties(REQUEST)
   Change existing object properties. Change object properties
by passing either a
   mapping object of name:value pairs {'foo':6} or passing
name=value parameters 

URL: -> http://zdp.zope.org/projects/zqr/ZopeQR
-

This should work:
 

Hope it helps!
 Sven

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