[Zope] Tree + post variables??
vanroose wim
vanroose@ruca.ua.ac.be
Fri, 10 Sep 1999 21:49:07 +0200
Zopees,
I have a simple, stupid question.
I have a page that has a variable in the URL example
"localhost:9673/TreePage?story_id=199093459087"
When I open the tree, which is generated with an sql method
thru branches_expr, by clicking on the plus sign the story_id
variable is not anymore accessible.
Because the url of the + sign does not contain the story_id variable.
I know, I still use the zope 1.3 but I didn't Have
time yet to upgrade.....
Code
<!--#with "_.namespace(obj_id=0)"-->
<!--#tree id=obj_id
branches_expr="SiteStruct(param=obj_id)" nowrap=1
single=1 -->
<!--#var name-->
<!--#if story-->
<!--#var story-->
<!--#/if-->
<!--#/tree-->
<!--#/with-->
And the sql method is
<!--#if param-->
select sid AS obj_id,descr AS name, isleave
from structure where pid=<!--#sqlvar param type=string-->
<!--#else-->
select sid AS obj_id,descr AS name,isleave
from structure WHERE pid=''<!--#/if-->
The structure table is
mysql> show columns from structure;
+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| sid | varchar(20) | | | | |
| descr | varchar(30) | | | | |
| pid | varchar(30) | | | | |
| isleave | varchar(10) | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+
You can dump some values in the database with
INSERT INTO structure VALUES ('1','Een','','');
INSERT INTO structure VALUES ('2','Twee','','');
INSERT INTO structure VALUES ('3','Drie','','');
INSERT INTO structure VALUES ('4','EenEen','1','Yes');
INSERT INTO structure VALUES ('5','EenTwee','1','Yes');
INSERT INTO structure VALUES ('6','TweeEen','2','Yes');
INSERT INTO structure VALUES ('7','TweeTwee','2','Yes');
INSERT INTO structure VALUES ('8','DrieEen','3','Yes');
INSERT INTO structure VALUES ('9','DrietWee','3','Yes');