hi,
can you provide some tutorials how to use ParsedXML?
 
thankx in advance.


On 11/1/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Send Zope mailing list submissions to
       zope@zope.org

To subscribe or unsubscribe via the World Wide Web, visit
       http://mail.zope.org/mailman/listinfo/zope
or, via email, send a message with subject or body 'help' to
       [EMAIL PROTECTED]

You can reach the person managing the list at
       [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Zope digest..."


Today's Topics:

  1. marshall zsql results (Christopher Rivard)
  2. Re: marshall zsql results (Tino Wildenhain)
  3. Silva (Piotr Konstanty)
  4. Re: Silva (bruno desthuilliers)


----------------------------------------------------------------------

Message: 1
Date: Sun, 30 Oct 2005 17:11:23 -0700
From: Christopher Rivard < [EMAIL PROTECTED]>
Subject: [Zope] marshall zsql results
To: zope@zope.org
Message-ID: <[EMAIL PROTECTED] >
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hello,

I am having a little difficulty with a result object from ZSQL.
The MySQL form input is a series of checkboxes that are creating a
"mapping table".

I have gone round and round and landed here:

The checkboxes are marshalled as:
list_map_dir_id:list:int

SQL like this:

<dtml-in list_map_dir_id>
insert into listing_map (list_map_dir_id, list_map_list_id) values
(<dtml-sqlvar sequence-item type=int>,
<dtml-sqlvar list_map_list_id type=string>
)
<dtml-var sql_delimiter>
</dtml-in>

MySQL data type is int for this column.

All of this works fine, but ideally I would like to manipulate the id's
as a list.

I have tried a few variations and regularly run into "len of unsized
object" if I try to insert as a varchar or insert the full list as
[0,1,2,3,4]
I have tried a few different MySQL data types, but no luck.

Retrieving the results like this:
select * from listing_map where list_map_list_id = <dtml-var list_id>

And mapping them back to the directory table like this:

select t1.*
from directory as t1
left join listing_map as t2
on t1.dir_id = t2.list_map_dir_id
where t1.dir_id = t2.list_map_dir_id && t2.list_map_list_id = <dtml-var
list_id>

Is there a way to marshall the results of this ZSQL object back into a list?

I am branching the subsequent forms based on the above query results.
The difficulty I am running into are exclusion situations

A and B not C

Seems like it would be easier if I could loop through and pull id's from
a list.  Maybe I'm asking the wrong question.


Thanks in advance,
Chris








------------------------------

Message: 2
Date: Mon, 31 Oct 2005 07:28:31 +0100
From: Tino Wildenhain < [EMAIL PROTECTED]>
Subject: Re: [Zope] marshall zsql results
To: Christopher Rivard <[EMAIL PROTECTED]>
Cc: zope@zope.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain

Am Sonntag, den 30.10.2005, 17:11 -0700 schrieb Christopher Rivard:
> Hello,
>
> I am having a little difficulty with a result object from ZSQL.
> The MySQL form input is a series of checkboxes that are creating a
> "mapping table".
>
> I have gone round and round and landed here:
>
> The checkboxes are marshalled as:
> list_map_dir_id:list:int
>
> SQL like this:
>
> <dtml-in list_map_dir_id>
> insert into listing_map (list_map_dir_id, list_map_list_id) values
> (<dtml-sqlvar sequence-item type=int>,
> <dtml-sqlvar list_map_list_id type=string>
> )
> <dtml-var sql_delimiter>
> </dtml-in>

This isnt that bad - you just get a bounch of insert statements
which should work.

> MySQL data type is int for this column.
>
> All of this works fine, but ideally I would like to manipulate the id's
> as a list.

SQL knows no list, so the above is probably best you can do.
Otoh, you could manipulate the values as ARRAY and use the
database functions to select from array to table - depending
on your database.

> I have tried a few variations and regularly run into "len of unsized
> object" if I try to insert as a varchar or insert the full list as
> [0,1,2,3,4]
> I have tried a few different MySQL data types, but no luck.
>
> Retrieving the results like this:
> select * from listing_map where list_map_list_id = <dtml-var list_id>

You should get into the habit of specifying the column names
literally to avoid changes of order and case of your columns
as they come from the database. Also you dont retrieve columns
you might not need (if you extend the table later).

> And mapping them back to the directory table like this:
>
> select t1.*
> from directory as t1
> left join listing_map as t2
> on t1.dir_id = t2.list_map_dir_id
> where t1.dir_id = t2.list_map_dir_id && t2.list_map_list_id = <dtml-var
> list_id>

Write AND instead of && - && isnt SQL standard and makes it harder for
you to change the database.

> Is there a way to marshall the results of this ZSQL object back into a list?

ZSQL objects is a bit confusing. You probably mean the DTML elements of
the ZSQL Methods. As I said, there is no list in SQL and Array
is a bit specific to databases. For example you could do something
like

<dtml-sqlvar expr="'{%s}' % ','.join([str(x) for x in list_id])"
type=string>

would render '{1,3,4,5,6}' to the database which in Postgres would
be an array.

> I am branching the subsequent forms based on the above query results.
> The difficulty I am running into are exclusion situations
>
> A and B not C
>
> Seems like it would be easier if I could loop through and pull id's from
> a list.  Maybe I'm asking the wrong question.

You should be able to optimize this by means of stored functions in your
database.



------------------------------

Message: 3
Date: Mon, 31 Oct 2005 09:22:12 +0000 (UTC)
From: Piotr Konstanty <[EMAIL PROTECTED]>
Subject: [Zope] Silva
To: zope@zope.org
Message-ID: < [EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii

I'm new in zope world. I would like to install Silva as a product in zope. When
I put all core silva product to lib/python/Products cataloge unpack it an
restart zope again every think seems to be good but when I want to do next step
from INSALL.txt of Silva namely on "add list" of ZMI I choose Slva root and
want to add it to zope root folder after I feed Id and Title on the "Add Silva
Root" page and I push "Add" button I receive "HTTP 500 - Inside Error of server
Internet Explorer". Where is an reason of this error? Any hints?



------------------------------

Message: 4
Date: Mon, 31 Oct 2005 11:37:05 +0100
From: bruno desthuilliers <[EMAIL PROTECTED]>
Subject: Re: [Zope] Silva
To: Piotr Konstanty < [EMAIL PROTECTED]>
Cc: zope@zope.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1

Piotr Konstanty wrote:
> I'm new in zope world. I would like to install Silva as a product in zope. When
> I put all core silva product to lib/python/Products cataloge unpack it an
> restart zope again every think seems to be good

How did you restart your zope instance ? If you want to make sure you
see start-time errors, you may want to use <ZOPE-INSTANCE>/bin/runzope
instead of <ZOPE-INSTANCE>/bin/zopectl start.

> but when I want to do next step
> from INSALL.txt of Silva namely on "add list" of ZMI I choose Slva root and
> want to add it to zope root folder after I feed Id and Title on the "Add Silva
> Root" page and I push "Add" button I receive "HTTP 500 - Inside Error of server
> Internet Explorer". Where is an reason of this error? Any hints?

I'd say that some required dependencies are missing.

To check this, you can either:
- have a look at <ZOPE-INSTANCE>/log/Z2.log
- stop your zope instance and restart it with runzope
- goto Control_Panel/Products in the ZMI and check if some products are
'broken' (they have a special icon)

HTH
--
bruno desthuilliers
développeur
[EMAIL PROTECTED]
http://www.modulix.com


------------------------------

_______________________________________________
Zope maillist  -  Zope@zope.org



End of Zope Digest, Vol 17, Issue 37
************************************

_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to