On the time being, I've had some time to play with FastDataGrid and
DataController. I've tried to factor out the SQLObject-specific code
from the widget and controller.

Instead of accepting a sql_class in their constructor, they accept a
data-adapter object. The role of this object is to provide the data and
the metadata to the grid and the controller. This object implements
select(), get_columns(), create(), update(), delete().

I've written an adapter class around SQLAlchemy's mapper, and it's easy
to do something similar for SO, based on the existing code in
TGFastData.

In my application, for instance, I inherit from SA_DataAdapter and
override the select() method, because I want to restrict the query (not
to display the whole dataset).

I continued to the formmaker, and added generic functions for
SQLAlchemy mapper properties. It currently covers the basic datatypes
and many-to-one relations.

So I have a functional orm-agnostic CRUD controller and grid, working
with simple SQLAlchemy schemes.

The implementation currently uses TG's DataGrid but it seems that it
will be easy to make it work with ToscaWidgets' DataGrid.

I'm interested in comments and suggestions.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to