On 10/10/07, Brian Rosner <[EMAIL PROTECTED]> wrote:
>
> I hope someone understands what I am getting at.

I do. You've pretty much discovered one of the reasons why I didn't
try to write formset_for_instances or something similar in the first
place. I just spent about a half hour thinking about it again and came
to the same conclusions. If you want to come up with a patch, I'll
definitely take a look and help try to iron it out, but as you've
already discovered, it's tricky. FWIW I'm working on a replacement for
form_for_instance that uses initial_data, but it'll probably be awhile
before I finish it up.

The oldforms file widgets have 2 separate html inputs, a hidden one
for the current file value, and second for the actual file input. I
think getting the file widget/field to render and check for such a
hidden field might be a cleaner and easier approach. The initial_data
function may need to be tweaked slightly to get this to work. I don't
remember what it does with file fields.

For instance, html for an oldforms file field looks like this:

<input type="file" id="id_photo_file" class="vImageUploadField"
name="photo_file" />
<input type="hidden" id="id_photo" name="photo"
value="img/photos/2007/10/10/blah.jpg" />

Joseph

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to