Jorge Godoy wrote:
>
> If anybody else uses it and had no problems, please say it here.
>
> I just don't want to break anything. :-)
>
Agreed. The absence of tg.paginate.reversed could break someone's app,
but I hesitate to put it in because it would be cruft. On the other
hand, API changes shouldn't occur during beta. Suggestions?
That brings me to another subject, the interface to ordering. The
ordering attribute is what tracks the ordering of all the fields. For
three fields, it may look like this:
{'fieldone':[0, True], 'fieldtwo':[1, False], 'fieldthree':[2,
True]}
The values in the dictionary contain the field order and a boolean for
Ascending order. This structure was designed for easy internal usage,
not as a public API. Should the field ordering be exposed in some
other fashion?
For SQLAlchemy support, it accepts a SelectResults instance which is
very similar to SQLObject's SelectResults. I'm wondering if maybe it
should accept a query instance instead and create the SelectResults
instance internally. That might save the developer a little trouble.
So it would go from this:
from sqlalchemy.ext.selectresults import SelectResults
paginate_input = SelectResults(tg_session.query(MySAClass))
to this:
paginate_input = tg_session.query(MySAClass)
Note that I'm using tg_session (turbogears.databse.session) because I'm
not using ActiveMapper classes with a default session.
What do you think? I'm starting to prefer the latter. That way if
SelectResults becomes a problem later (not maintained, feature limited,
etc.), paginate can use a different approach internally without
breaking the API.
So I'm leaning towards:
1. Making a compatible reversed attribute.
2. Requiring only a SA query (not a SelectResults instance).
Thoughts?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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
-~----------~----~----~----~------~----~------~--~---