Hello Django developers,
as this is my first post here, let me shortly introduce myself:
I'm Fabian Büchler, webdeveloper from Vienna, Austria; relatively new to
Django and just thinking about hacking on Django itsself ...
I've read all your contribution guidelines and I believe this to be the
correct place for my concern - please correct me if I'm wrong.
I have a suggestion for improvement to the Django admin, namely the
DateTimeShortcuts - especially in combination with model inlines.
*The big picture*
In a project I'm working on an event management tool for the Vienna tourist
board and one of our models is heavily date based:
Event 1<n EventDate (used in a tabular inline within Event change forms).
Each EventDate has two date fields and two time fields, that means four
date/time pickers per inline row.
When adding new rows using the "Add new row" link, this is already quite
slow. The more inline rows are on the page, the slower it gets.
In addition to that, I've built a generator tool for these inlines which
generates EventDates by requested patterns (per weekday, for a certain date
When generating more than a hand full of inline rows at a time, the browser
slows down to a halt - continuous JS timeouts included.
All this happens on multiple, relatively new computers (all OSes), in the
newest browsers (FF3.6, FF4b10,...).
After some JS profiling I found, that the problem seems to be burried within
the reinitialization of all .datetimeshortcuts every time a new inline row
is being added.
*My improvement suggestion*
As a solution I would suggest to rewrite the complete DateTimeShortcuts.js
using jQuery (it is not jQuery based at all atm.), especially jQuery's new
(1.4.2) event delegation functionality  to improve performance. With
event delegation, no reinitialization of newly added .datetimeshortcuts
elements would be necessary at all.
As an addition, I think it would make sense to integrate the jQuery UI
datepicker (maybe with a timepicker extension ) instead of the existing
one, because that might resolve some problems, as with the datepicker
opening outside of the viewport when the calendar icon is too far on the
right side of the screen.
I am willing to try to implement this myself (and, of course, provide any
outcomes to the community).
But before starting, I first wanted to hear your opinions to my suggestion
and - if accepted - any pointers to how you would like this to be
Please, feel free to ask for more information about what exactly I'm doing.
I could also set up a little demo page to illustrate the situation.
Looking forward to any input and feedback!