Kate, that was... On Fri, Nov 26, 2010 at 9:07 PM, Sithembewena Lloyd Dube <zebr...@gmail.com>wrote:
> So, I am making headway. Thanks to the gentlemen who nudged me onto the > right path. > > Quick word to Bruno Desthuilliers: while I appreciate that you have greater > experience and might find others' endeavours ridiculous, you could be more > helpful and respectful in your tone. Do you see a difference between your > response and that of Tom Evans, for example? There is a civilised way to > disagree. > > This was not the first time that you and I have had something of a spat > regarding your demeanour on this mailing list. The last time, you attacked a > total novice to Django with the same air of wanton condescension -and worse, > you condescended to Kaste (an experienced Django user) who was trying to > come to the aid of said newbie. > > This is a place where people 'fraternise', and mostly the goal of it all > is to enlighten those that need to be enlightened. There is *absolutely* no > reason to be uncouth about it. You were also once devoid of comprehension, > and you gradually attained it, in no small part thanks to others' patience > and advice. > > Regards, > Lloyd > > > > > On Fri, Nov 26, 2010 at 5:58 PM, Sithembewena Lloyd Dube < > zebr...@gmail.com> wrote: > >> Thanks for breaking this down, Tom. I'll play around with it and see if >> I'm grasping this. >> >> Regards, >> Lloyd >> >> >> On Fri, Nov 26, 2010 at 5:55 PM, Tom Evans <tevans...@googlemail.com>wrote: >> >>> On Fri, Nov 26, 2010 at 3:44 PM, Sithembewena Lloyd Dube >>> <zebr...@gmail.com> wrote: >>> > Thanks Daniel, makes sense. I gather that what Bruno meant to say on >>> his >>> > soapbox was that the file is in the HTTP request object and can/ should >>> not >>> > be accessible from the hard disk? >>> > >>> > I was familiar with that, as the file upload dialogue does the job of >>> > reading the file off the disk and into memory. >>> > >>> > So I see where I went wrong :) I was trying to read the file off the >>> disk. >>> > I'll see if I can manipulate the file in a view, where I have access to >>> the >>> > request object. >>> > >>> > Is that the gist of the problem? >>> > >>> > Thanks Daniel! >>> > >>> >>> Not really. >>> >>> 1) User chooses file from disk >>> 2) Browser reads file from disk, and generates POST request >>> 3) Django receives POST request, and generates temporary file to store >>> received POST data >>> 4) Django model form processes request, and moves temporary file into >>> the location specified by upload_to attribute on model field >>> 5) You save the model instance, which puts us into the save() method, >>> where you want to create a thumbnail of the file >>> >>> At this point, the full size image is on disk, in >>> os.path.join(settings.MEDIA_ROOT, instance.file_field.path). You want >>> to read that image in, create a django.core.files.File (or subclass) >>> instance for the thumbnailed image, and assign it to the thumbnail >>> field on the model. >>> >>> Cheers >>> >>> Tom >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Django users" group. >>> To post to this group, send email to django-us...@googlegroups.com. >>> To unsubscribe from this group, send email to >>> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/django-users?hl=en. >>> >>> >> >> >> -- >> Regards, >> Sithembewena Lloyd Dube >> http://www.lloyddube.com >> > > > > -- > Regards, > Sithembewena Lloyd Dube > http://www.lloyddube.com > -- Regards, Sithembewena Lloyd Dube http://www.lloyddube.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.