[Zope] Help with Tables
Jónas Sigurðsson
jonas@nasaweb.net
Wed, 18 Dec 2002 21:04:37 +0100
This is a multi-part message in MIME format.
------=_NextPart_000_000E_01C2A6D9.1397E170
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
Is there any specific reason for why there isn't a standard datagrid =
product
for displaying information this manner, just like there is in .NET
(DataGrid) and other popular platforms. A component for displaying rows =
of
data, sortable and/or editable. Since I'm rather new to Zope I always
thought I was missing something obvious. Am I ?
Regards,
J=F3nas
-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org] On Behalf Of Ben
Avery
Sent: 18. desember 2002 19:39
To: Lindstrom Greg - glinds
Cc: 'zope@zope.org'
Subject: Re: [Zope] Help with Tables
hi Greg,
I'm not sure of any existing products which would do this, but it's easy =
enough to do yourself.
1. The column header needs to be a link back to the page, but specifying =
the column name, so an optional 'order by' clause in the zsql method.=20
but the dtml-sqlvar tag puts quotes around its values, so this wouldn't=20
work. and it wouldn't be safe to just use <dtml-var ...> inside a zsql=20
method as someone could hack your site and call it with the column name=20
e.g. 'dummy; drop table users'.
I would do this with each table display page as a folder with an=20
index_html python script, a zsql method, and a display method. The=20
python script takes an optional parameter of the column name, or sets a=20
default. it checks this against a list of metadata about your table with =
the column names, and throws an error if this isn't in your 'safe' list. =
It then calls the zsql method with the column name, which has an 'order=20
by <dtml-var col_name>' clause.
2. you need to make a page which displays the detail of the particular=20
item given its primary key. I'd have a python method (say 'detail')=20
which picks up the key id as parameter, calls a zsql method to get the=20
info from the database, and sends it to a display method (dtml or zpt).
The item in the first page is an <a href=3D"detail?key=3D&dtml-KEY;"> =
(in=20
DTML, with KEY being a variable with the primary key value) link to the=20
python script 'detail', which replaces the key id when generated. So=20
this becomes a link to the detail page for each item.
hope this helps
Ben Avery
Lindstrom Greg - glinds wrote:
> Greetings-
> I am in the process of designing three (count 'em 3) projects in Zope =
and
> have spotted a common theme running through them. I have pages which
lists
> information stored in a Gadfly (for now) table via a ZSQLMethod. I =
would
> like to add the following features to my tables;
>=20
> 1. The ability to click on the column header to sort the table by =
that
> column (member number, name, etc.)
> 2. The ability to click on an entry in the table to bring up more
> information about the particular item. For example, clicking on a =
member
> number might bring up a form showing more information about the =
member.
>=20
> Is there documentation as how to go about doing this? Or can one of =
you
> point me to a page that does it already?
>=20
> Thanks!
> --greg
>=20
> Greg Lindstrom
> The limits of language are the limits of one's world=20
> --Ludwig von Wittgenstien
>=20
>=20
>=20
>=20
>=20
>=20
> **********************************************************************
> The information contained in this communication is
> confidential, is intended only for the use of the recipient
> named above, and may be legally privileged.
> If the reader of this message is not the intended
> recipient, you are hereby notified that any dissemination,=20
> distribution, or copying of this communication is strictly
> prohibited.
> If you have received this communication in error,
> please re-send this communication to the sender and
> delete the original message or any copy of it from your
> computer system. Thank You.
>=20
>=20
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -=20
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>=20
_______________________________________________
Zope maillist - Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -=20
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )
------=_NextPart_000_000E_01C2A6D9.1397E170
Content-Type: application/ms-tnef;
name="winmail.dat"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="winmail.dat"
eJ8+IiYUAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5NaWNy
b3NvZnQgTWFpbC5Ob3RlADEIAQ2ABAACAAAAAgACAAEGAAcAAQAAAAAAAAEGgAMADgAAANIHDAAS
ABUABAAAAAMAEwEBA5AGAIwPAAAuAAAACwACAAEAAAALACMAAAAAAAMAJgAAAAAACwApAAAAAAAD
AC4AAAAAAAIBMQABAAAAGAAAAA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