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

Samir Mishra SamirMishra@cbuae.gov.ae
Tue, 20 May 2003 09:41:58 +0400


Hello all,

I've been following the examples, documentation, etc. and have not been able
to figure this out, something I consider ought to be TRIVIAL!!

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

In Zope, I have a corresponding ZSQL method getHolidays -
select date, occasion from holidays order by date

In a python script, context.getHolidays().data_dictoinary() returns -
{
  'date': {
    'name': 'date', 
    'type': 'd', 
    'parser': <class DateTime.DateTime.DateTime at 00C69B7C>, 
    'width': 23
  },
  'occasion': {
    'name': 'occasion', 
    'type': 't', 
    'parser': <function parse_text at 011B1294>, 
    'width': 40
  } 
}

(Formatting for convenience). This is not what I ought to get, I think!

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'

It's extremely annoying, not being able to do something as simple as this!
Does anyone know what may be going on?

Thanks in advance...

Regards,
Samir