Opened 17 years ago

Closed 13 years ago

Last modified 11 years ago

#4481 closed Cleanup/optimization (wontfix)

Databrowse should use pagination

Reported by: anonymous Owned by: nobody
Component: contrib.databrowse Version: dev
Severity: Normal Keywords:
Cc: floguy@…, carlo.miron@…, travis.pinney@…, dane.springmeyer@…, bas@…, dvanliere@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Right now there is no pagination for the databrowse contrib app.

After attempting to use it on a legacy database with many records, my entire computer froze up from trying to access so much information from the database. Looking through the code, it seems very different from any other django code that I've seen, and I am not able to figure out a way (on my own) to implement object pagination.

Attachments (3)

ticket4481.patch (5.2 KB ) - added by floguy@… 17 years ago.
first implementation of pagination on object instances
ticket4481-rev2.patch (6.1 KB ) - added by floguy@… 17 years ago.
The previous ticket was a mistake to upload: it was old. This is the correct ticket.
databrowse_pagination_calendars.diff (25.0 KB ) - added by floguy@… 17 years ago.
Heavily updated patch

Download all attachments as: .zip

Change History (18)

comment:1 by Chris Beaven, 17 years ago

Summary: Databrowse chokes on large databasesDatabrowse should use pagination
Triage Stage: UnreviewedDesign decision needed

I think you're right, databrowse probably should be using pagination. I'll leave as a design decision for the big cheeses though.

comment:2 by floguy@…, 17 years ago

Cc: floguy@… added
Has patch: set

I have implemented this today. I have *no* clue if it's a good way of going about it, but it's been working flawlessly for me today.

The only problem is that I also modified one other thing with this patch: decouple presentation from logic. In trunk, the str method of django.contrib.databrowse.datastructures.EasyInstance cuts off any characters after 30. In my patch, I bring that out of the data structures class and into the template with a templatetag.

I know that it's bad to put two items in one patch, but my svn diff is giving me this.

by floguy@…, 17 years ago

Attachment: ticket4481.patch added

first implementation of pagination on object instances

by floguy@…, 17 years ago

Attachment: ticket4481-rev2.patch added

The previous ticket was a mistake to upload: it was old. This is the correct ticket.

comment:3 by Dorian, 17 years ago

Hi floguy!

Thanks for the patch very much. Thats just what I was looking for!

But when I executed

patch -i ticket4481-rev2.patch -p0

the file

django/contrib/databrowse/templatetags/__init__.py

was not created, because it is empty.
So I had to create it by hand to make the patch work properly.

Maybe there is a switch I should have used with the 'patch' command...

cheers
Dorian

comment:4 by floguy@…, 17 years ago

I have made a LOT of updates to this code. My original patch was a 20-min deal, but this one has been me iterating over it on and off since my first attempt. It also fixes Calendars, so that at any point in the drill-down, you can break off and see the objects.

E.g. Start at years (2006, 2007), but you can select "See Objects ->" to get any object from 2006 or 2007.

Then drill down to 2006. You see all of the months that have objects. But for each one, you can select "See Objects ->" to get an object for that month.
Then drill down to June. You see all the days... etc. and so on and so forth until you get to days. At that point you are forced to see the objects for that day.

I'm doing a terrible job of explaining this, but if you apply the patch and look at something which should be paginated, or view by calendar, it will immediately become clear.

I know that I tackled too much for one patch, but I did it because I needed the functionality, and I'm not good at fudging with diffs. Hopefully my work will help someone else as well.

by floguy@…, 17 years ago

Heavily updated patch

comment:5 by anonymous, 17 years ago

Cc: carlo.miron@… added

comment:6 by tlp, 17 years ago

Cc: travis.pinney@… added

comment:7 by Ivan Fedorov, 16 years ago

Last patch isn't finished. It doesn't paginate child sets.

comment:8 by springmeyer, 16 years ago

Cc: dane.springmeyer@… added

Any movement on this?

comment:9 by Vasily Ivanov, 16 years ago

Cc: bas@… added

is it going to be included in the official release?

comment:10 by Alex Gaynor, 14 years ago

Triage Stage: Design decision neededAccepted

comment:11 by drdee, 14 years ago

Cc: dvanliere@… added

Will this be part of Django 1.3?

comment:12 by Gabriel Hurley, 14 years ago

Severity: Normal
Type: Cleanup/optimization

comment:13 by Julien Phalip, 14 years ago

Easy pickings: unset
Needs tests: set

comment:14 by Preston Holmes, 13 years ago

Resolution: wontfix
Status: newclosed
UI/UX: unset

Databrowse is now deprecated, see #16907

comment:15 by Alireza Savand, 11 years ago

Note: See TracTickets for help on using tickets.
Back to Top