« first day (827 days earlier)      last day (4107 days later) » 

2:20 AM
 
 
5 hours later…
DON
7:35 AM
ih
anybody here?
hi
 
 
13 hours later…
8:49 PM
3
A: Why has the "Python" chat room been merged to "Python and Robotics"?

Jeremy BanksCan this be changed back now? There's been no chat in the room for a couple of weeks; instead there's been a lot of activity in the newly-created Everything Python room. This has been the Python chat room for years, and adding "and Robotics" doesn't seem to done much good. The Python chat room w...

 
9:22 PM
3
A: Resubmitting Image in ImageField after Validation Error in Django

Yuji 'Tomita' TomitaHTML <input type="file"> fields cannot be prepopulated with data. Therefore, if validation fails on another field, you will have to re-select the image. It's a HTML / browser security measure. As in, no way around it! Imagine if a site could inject C:\Windows\something_important into a f...

I am disappointed that Django doesn't do something smarter here. It should save the image to the server even if it hasn't yet been associated with an instance in the database.
I'll check out that django-file-resubmit plugin mentioned in the other answer; it looks like it does the sensible thing.
It doesn't seem to be working for me. I wonder if that's because I'm rendering my widgets directly (as str(form.field_name), for example) rather than the whole form itself.
 
9:47 PM
Nope, I was just using it incorrectly! It's working great now.
I hadn't customized widgets in a ModelForm before, and copied
    widgets = {
        'picture': AdminResubmitImageWidget,
        'file': AdminResubmitFileWidget,
    }
from the example, thinking 'picture' was a type of widget to replace, not realizing that I was supposed to specify the names of fields whose widgets I was replacing.
 

« first day (827 days earlier)      last day (4107 days later) »