Ticket #1115 (closed enhancement: invalid)
[PATCH] paginate.py SA support, better sorting and bug fix for compund widgets
| Reported by: | randall@… | Owned by: | alberto |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.5 |
| Component: | SQLAlchemy | Version: | 0.9a5 |
| Severity: | normal | Keywords: | |
| Cc: |
Description (last modified by faide) (diff)
Included is a patch for paginate.py which does the following thing:
- Fix problem with form submission from compound widget.
- Add support for SQLAlchemy using SelectResults? in sqlalchemy.ext.selectresults
- Add multi-field sorting so that all fields are sorted in reverse of the order chosen.
This is based on this discussion:
http://groups.google.com/group/turbogears/browse_thread/thread/834a0e04ac9425a5
Attachments
Change History
Changed 5 years ago by randall@…
-
attachment
paginate.py.diff.1
added
Changed 5 years ago by randall@…
-
attachment
paginate.py.diff.2
added
fixes sorting bug and clean up log.info entries
Changed 5 years ago by randall@…
-
attachment
paginate.py.diff.4
added
adds compatibility for tg.paginate.reversed attribute
Changed 5 years ago by randall@…
-
attachment
paginate.py.diff.5
added
fix issue with no default order specified
comment:1 Changed 5 years ago by jorge.vargas
- Milestone set to 1.0b2
- Component changed from TurboGears to SQLAlchemy
- Summary changed from paginate.py SA support, better sorting and bug fix for compund widgets to [PATCH] paginate.py SA support, better sorting and bug fix for compund widgets
Changed 5 years ago by sbr77
-
attachment
paginate.py.diff.1a
added
patch to fix form data only (no SA or sorting changes)
comment:2 Changed 5 years ago by sbr77
paginate.py.diff.1a is a very simple patch that just fixes the form data submission issues. No SA support or multi-field ordering. If you're just having trouble with forms, this is the patch I recommend because it is so simple. Otherwise use patch 6 (as of today).
comment:3 Changed 5 years ago by sanjay
Feedback - after applying paginate.py.diff.6 to my 1.0b2 installation, @paginate with sqlalchemy works nicely for me.
comment:4 Changed 5 years ago by alberto
A short unittest for this would be nice so we make sure we don't get regressions when fixing other things. I'll try to write one as soon as I have a chance but if someone who is using this can contribute one before I do it will probably get comitted sooner :)
Alberto
comment:5 Changed 5 years ago by guest
I would gladly write tests, but have had difficulty doing so. See this discussion:
Randall
comment:8 Changed 5 years ago by alberto
- Status changed from new to assigned
- Owner changed from anonymous to alberto
comment:9 Changed 5 years ago by alberto
- Summary changed from [PATCH] paginate.py SA support, better sorting and bug fix for compund widgets to paginate.py SA support, better sorting and bug fix for compund widgets
paginate.py.diff.g no longer applies cleanly. I get:
(Turbogears)jal:~/src/python/checkouts/turbogears/turbogears alberto$ patch -p0 < ~/Desktop/paginate.py.diff.6 patching file paginate.py Hunk #2 FAILED at 4. Hunk #3 succeeded at 30 (offset 3 lines). Hunk #4 succeeded at 55 (offset 3 lines). Hunk #5 succeeded at 99 (offset 3 lines). Hunk #6 succeeded at 134 (offset 3 lines). Hunk #7 succeeded at 183 (offset 3 lines). Hunk #8 succeeded at 218 (offset 3 lines). 1 out of 8 hunks FAILED -- saving rejects to file paginate.py.rej
Can someone please update it? Removing [PATCH] for the meantime.
Alberto
BTW: please run svn diff > ma_patch.diff from the *root* of your svn checkout to get an unified diff that's easier to apply.
TODO: Explain this somewhere to ease the job of future contributors...
comment:11 Changed 5 years ago by guest
Kevin made this change:
r2326 | kevin | 2007-01-02 09:02:15 -0600 (Tue, 02 Jan 2007) | 2 lines
makes SQLObject optional
It's very minor. I'll create a new patch.
-Randall
Changed 5 years ago by guest
-
attachment
paginate.py.diff.7
added
new patch to work with current 1.0 branch
comment:12 Changed 5 years ago by alberto
- Status changed from new to assigned
- Owner set to alberto
- Summary changed from paginate.py SA support, better sorting and bug fix for compund widgets to [PATCH] paginate.py SA support, better sorting and bug fix for compund widgets
comment:13 Changed 5 years ago by alberto
- Status changed from assigned to closed
- Resolution set to fixed
Comitted at [2404]. Thanks! :)
Alberto
comment:14 Changed 4 years ago by vhata
- Status changed from closed to reopened
- Resolution fixed deleted
There's a slight bug in sorting: the tg_paginate_order parameter does not get taken into account. The fix is as follows:
elif default_order and not ordering:
ordering = {default_order:[0, not default_reversed]}
- elif ordering and order:
+ if ordering and order:
sort_ordering(ordering, order)
log.debug('ordering %s' % ordering)
Patch attached.
comment:15 Changed 4 years ago by vhata
In addition, the tg_paginate_reversed parameter (documented at http://docs.turbogears.org/1.0/PaginateDecorator ) does not appear to be used at all.
I've attached a patch which adds this functionality, although it could probably be done more elegantly?
comment:17 Changed 4 years ago by faide
- Description modified (diff)
- Milestone changed from 1.1 to 1.1.1
comment:19 Changed 2 years ago by Chris Arndt
- Status changed from reopened to closed
- Resolution set to invalid
Cruft ticket. Paginate was seriously refactored after the patches here were created. Closing ticket as invalid.
patch for paginate.py