On Sunday, August 07, 2011 11:30:41 am OKB (not okblacke) wrote:
> =?UTF-8?B?SmFjZWsgS2HFgnVja2k=?= wrote:
> > UÅŒytkownik OKB (not okblacke) napisaÅ:
> >> I tracked down the source of the problem. The issue is
> >> that
> >>
> >> dCursorMixin uses DataStructure to determine whether the given
> >> column is valid for a sort. The DataStructure code, in turn,
> >> relies on the BackendObject's getStructureDescription method. But
> >> this method uses something called getStructureOnlySQL, and that
> >> uses getSQL --- bypassing the UserSQL. The result is that, even
> >> when UserSQL is specified, the cursor tries to get the
> >> DataStructure by using the auto-generated SQL. This fails when
> >> custom SQL returns different columns than are present in the
> >> table, since then the actual results don't match the "structure-
> >> only" description.
> >
> > Hi.
> > I guess that if you define your dBizobj.DataStructure manually in
> > the class initProperties method, then everything should works fine.
> > Try to do this.
>
> Yeah, that's actually what I wound up doing. But it would still be
> good if there were a way to refresh this from the DB. The only way I
> could figure out the format that DataStructure wanted was by getting the
> real one from the DB and copy-and-pasting it. The documentation lists
> the six elements that the tuple is supposed to contain, but doesn't
> explain them (e.g., what is "data type code"?).
Below is a list from the dbPostgres.py which should provide a little insight
to the data types.
fldTypeDict= {"int4":"I", "int8":"I", "int2":"I","varchar": "C", "char":
"C",'bpchar': 'C', "bool":"B", "text": "M", "numeric":"N", "double":"F",
"real":"F","float4":"F", "float8":"F", "datetime":"T", "timestamp":"T",
"date": "D","bytea": "L", "point":"C", "box":"C", "circle":"C", "lseg":"C",
"polygon":"C", "path":"C","oid":"I"}
Some where deep in the Dabo code there is an official list. I can recall
finding them years ago.
Concerning your problem of having to create a dynamic grid data structure.
Have you considered using a view? It sounds like you are using the grid in a
read only manner and you could use a view for read only interactions. If by
chance you are using Postgres - you can use Rules to allow inserts, deletes,
and updates for views.
Johnf
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]