[Zope-DB] ZSQL Method dictionaries() failing - Please help!

Eric Kamm eric@analyticinnovations.com
Tue, 20 May 2003 08:39:08 -0500


Samir,

I notice that dictionaries may be misspelled as dictoinaries
I actually see it both ways telling me you didn't just
copy/paste the code and the exception.  Hopefully the
problem is as simple as that.  If not, I'm sorry.

Looking at this Python source code might help you figure
things out:

    ${YOUR_ZOPE}/lib/python/Shared/DC/ZRDB/Results.py


Eric Kamm
Analytic Innovations, LLC
www.analyticinnovations.com=20


> -----Original Message-----
> From: zope-db-admin@zope.org [mailto:zope-db-admin@zope.org]On Behalf =
Of
> Samir Mishra
> Sent: Tuesday, May 20, 2003 12:42 AM
> To: 'zope-db@zope.org'
> Subject: [Zope-DB] ZSQL Method dictionaries() failing - Please help!
>=20
>=20
> Hello all,
>=20
> I've been following the examples, documentation, etc. and have not =
been able
> to figure this out, something I consider ought to be TRIVIAL!!
>=20
> I connecting to a MS SQL Server using ODBC on Win2000. I have a table =
in the
> DB called holidays containing 2 columns, 'date' and 'occasion' (should =
be
> self-explanatory).
>=20
> In Zope, I have a corresponding ZSQL method getHolidays -
> select date, occasion from holidays order by date
>=20
> In a python script, context.getHolidays().data_dictoinary() returns -
> {
>   'date': {
>     'name': 'date',=20
>     'type': 'd',=20
>     'parser': <class DateTime.DateTime.DateTime at 00C69B7C>,=20
>     'width': 23
>   },
>   'occasion': {
>     'name': 'occasion',=20
>     'type': 't',=20
>     'parser': <function parse_text at 011B1294>,=20
>     'width': 40
>   }=20
> }
>=20
> (Formatting for convenience). This is not what I ought to get, I =
think!
>=20
> On the other hand, to get the contents of the table 'holidays', when I
> execute context.getHolidays().dictoinaries(), I get -
> Error Type: AttributeError
> Error Value: DatabaseResults instance has no attribute 'dictionaries'
>=20
> It's extremely annoying, not being able to do something as simple as =
this!
> Does anyone know what may be going on?
>=20
> Thanks in advance...
>=20
> Regards,
> Samir
>=20
> _______________________________________________
> Zope-DB mailing list
> Zope-DB@zope.org
> http://mail.zope.org/mailman/listinfo/zope-db
>=20