Hi all

I've just started porting one of our in-house applications to Django to
see if it can save us some time. We're currently stuck with a horrible
Java framework which is an absolute pain to work with, so I'd be very
happy to switch. However, if I'm gonna sell that to the bosses, I'll
have to prove that I can replicate the most important part of the UI
very quickly, otherwise they will see no reason to switch as what we
currently have does after all work.

So, getting the basic administration up and running was so easy I had
to laugh, I was absolutely thrilled at seeing functionality that we
don't even have in our current version just by a few declarations in
the model. But now that I've finished the simple part, I'm up against
the first wall. The application is used to manage projects. Projects
can have multiple subprojects, and each subproject is basically just
the name of the technology used, and a collection of year, value pairs
(reductions). So the foreign key setup is that Reduction refer to
SubProject which refer to Project.

Now, I need to be able to edit the subprojects in the context of the
containing project, as they simply don't make any sense in any other
context. But the default option that Django offers here is too simple.
I've read some postings here indicating that improvements are on their
way, but that was from back in November last year, and nothing seems to
have happened. And I'm not sure those improvements would solve my
problem anyway. I could probably used the regular "edit inline stacked"
for the subproject, but each subproject would also have to contain a
list of year, value pairs.

So what I thougth I could do was to override the
edit_inline_stacked.html template in the admin. I created a new variant
of this and saved it as
projectroot/templates/admin/appname/project/edit_inline_stacked.html
when I make changes to this however, nothing happened. I read somewhere
that it should be possible to override any template, at any level of
the hiearchy, so in this case I'm trying to override the template for
the Project instances. But I can't seem to get it working.

Anyway, given that I can get that to work, it would be preferable if
the year, value pairs could be easily created using a javascript call.
So there would be a function that the user can use to create year,
value pairs for a given period, for example 2000-2008 with the value
10000. Once this has been created (it should just create a bunch of
input fields of course), he can edit the values, typically the first
and last will vary.

But I'm not sure how I can integrate this with the existing admin
functionality. Is there any way I can hook into the admin code which
runs when I hit save? Ideally I'm imagining that as I get the request I
know how to extract the year, value pairs, and I could just create
Reduction instances out of these and put them in the automatically
created inverse set in SubProject (that was a sweet feature btw!), and
when the save() is called on the SubProject, the reduction_set will
also be saved.

Also how do I know what sort of data is available to me in the
edit_inline_stacked.html template? I can't seem to find the docs...
Some references would be great.

And if improvements to this part of the admin module are on their way,
is there any way I can access these to give them a try? Hell, maybe
even try to help develop them!


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

Reply via email to