#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)
Change History (18)
comment:1 by , 18 years ago
Summary: | Databrowse chokes on large databases → Databrowse should use pagination |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
comment:2 by , 18 years ago
Cc: | 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 , 18 years ago
Attachment: | ticket4481.patch added |
---|
first implementation of pagination on object instances
by , 18 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 , 18 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 , 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.
comment:5 by , 17 years ago
Cc: | added |
---|
comment:6 by , 17 years ago
Cc: | added |
---|
comment:10 by , 14 years ago
Triage Stage: | Design decision needed → Accepted |
---|
comment:12 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Cleanup/optimization |
comment:13 by , 14 years ago
Easy pickings: | unset |
---|---|
Needs tests: | set |
comment:14 by , 13 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
UI/UX: | unset |
Databrowse is now deprecated, see #16907
comment:15 by , 12 years ago
We've fixed this issue on;
https://github.com/Alir3z4/django-databrowse
I think you're right, databrowse probably should be using pagination. I'll leave as a design decision for the big cheeses though.