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.

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.

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.