I'm just getting familiar with Django and I think I've got all the
basics... and I have lots of experience with Python and MySQL, but I'm
having a hard time figuring out how to do something that would be easy
for me in plain Python.  One of the problems I keep finding with
various pieces of documentation is that they show code snippets
without showing *where* they go... sometimes that's obvious, but
sometimes not so much.  Anyway, a little guidance on this simple thing
would help me immensely.

I need to create a form that updates values for a bunch of database
rows.  The wrinkle is that the model from which I'm getting the form
data isn't the same as the model I'm going to update.  The form should
look like a list of values followed by several checkboxes.  The user
will look down the list and check off the appropriate boxes.  When
submitted, the form should update corresponding Boolean fields in the
target table.

The reason there are two underlying tables and models is that the
source is a rollup of the target; they are essentially identical, but
querying the raw data is slow, so the system does a rollup
periodically, from which the form needs to grab an ordered list.

So... I need to populate the form with the name and ids of a number of
rows from the source table (pardon me for mixing database and object
terminology here...) and I can't figure how to do that.  Obviously
there's a for loop involved, but, well, I just can't quite grok how to
put this together.

Processing the form means updating the target with the new Boolean
values selected by the user in the form, of course.

If anybody has an example that does something like this, that'll be
great.

Thanks in advance,

Nick



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to