On Jan 7, 4:55 pm, Nathaniel Whiteinge <[EMAIL PROTECTED]> wrote:
> On Dec 26 2007, 2:50 pm, jdetaeye <[EMAIL PROTECTED]> wrote:
>
> > The implementation is not based on customizing the admin, but
> > implementing a generic view with very similar capabilities as the
> > django changelist view. In all, around 800 lines of code.
>
> Johan, that screenie looks very nice. Any chance you're able to share
> that code?

The code is part of my open source project frePPLe.
It'll take you a while to untangle the part you're interested in from
the rest...

The code also handles some additional functionalities:
- support for "table" reports, where time buckets are represented as
columns
- allow raw sql to generate the report data
- use of 'last-modified' html-header to avoid unnecessary recomputing
of the (complex) database query
- uses admin-like syntax to define the reports

The report code in held in this file:
http://frepple.svn.sourceforge.net/viewvc/*checkout*/frepple/trunk/contrib/django/freppledb/utils/report.py?revision=629&content-type=text%2Fplain

The javascript code:
http://frepple.svn.sourceforge.net/viewvc/frepple/trunk/contrib/django/freppledb/static/frepple.js?view=markup
My code uses the prototype javascript library and also handles other
context menu in the application, so you might be better off starting
from scratch according to your needs and taste.
The main trick in choosing the filter operator is to dynamically
change the "name" property of some form fields. For instance the
orginal html-form may have:
   <input name="myfield_gte" value="10"/>
which is changed with some javascript to:
   <input name="myfield_lt" value="10"/>

In the future I am planning to further enhance the functionality.
On the wishlist:
- ability to import csv formatted data
- ability to sort on multiple columns

If there is sufficient interest this could be turned in a reusable
component. People could then use it as a replacement for the standard
object-list admin screens.

Regards,

Johan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to