Re: Django Multiple File Upload for latest versions

2019-08-28 Thread Abu Yusuf
Thanks for your valuable feedback. I will try to fix all those.

On Tue, Aug 27, 2019 at 4:46 PM Sim  wrote:

> here is my newbie opinion :
> https://github.com/Revel109/django-multiupload-lts/issues/1
>
> good luck
>
> On Tue, Aug 27, 2019 at 9:30 AM Abu Yusuf 
> wrote:
>
>> Hey there, I have checked a lot of git projects for django latest
>> versions 'multiple file upload' but couldn't find a great one.
>>
>> Here i have created a repo for this:
>> https://github.com/Revel109/django-multiupload-lts
>>
>> Please check this out and create issues if you have any :)
>>
>> This project is live here: https://django-multiup-lts.herokuapp.com/
>>
>> Thanks.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/02aedca4-955f-400d-8226-ba4eee1d560b%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/02aedca4-955f-400d-8226-ba4eee1d560b%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJenkLBLcWc1PyJt2tBR-eUwjHMdQw2sK_OrFZ2ywcmBk-dbrw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAJenkLBLcWc1PyJt2tBR-eUwjHMdQw2sK_OrFZ2ywcmBk-dbrw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACNsr286uT7JeDnVDUC8W4a7wfhHYotmENTNQJWLhE1Bb5Woww%40mail.gmail.com.


Re: Django Multiple File Upload for latest versions

2019-08-27 Thread Sim
here is my newbie opinion :
https://github.com/Revel109/django-multiupload-lts/issues/1

good luck

On Tue, Aug 27, 2019 at 9:30 AM Abu Yusuf 
wrote:

> Hey there, I have checked a lot of git projects for django latest versions
> 'multiple file upload' but couldn't find a great one.
>
> Here i have created a repo for this:
> https://github.com/Revel109/django-multiupload-lts
>
> Please check this out and create issues if you have any :)
>
> This project is live here: https://django-multiup-lts.herokuapp.com/
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/02aedca4-955f-400d-8226-ba4eee1d560b%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/02aedca4-955f-400d-8226-ba4eee1d560b%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJenkLBLcWc1PyJt2tBR-eUwjHMdQw2sK_OrFZ2ywcmBk-dbrw%40mail.gmail.com.


Django Multiple File Upload for latest versions

2019-08-27 Thread Abu Yusuf
Hey there, I have checked a lot of git projects for django latest versions 
'multiple file upload' but couldn't find a great one.

Here i have created a repo for this: 
https://github.com/Revel109/django-multiupload-lts

Please check this out and create issues if you have any :) 

This project is live here: https://django-multiup-lts.herokuapp.com/

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/02aedca4-955f-400d-8226-ba4eee1d560b%40googlegroups.com.


Re: multiple file upload from image filed in django admin

2017-02-05 Thread ludovic coues
Have you found this piece of the doc ?
https://docs.djangoproject.com/en/1.10/topics/http/file-uploads/#uploading-multiple-files

2017-02-05 0:13 GMT+01:00 Amit Pathak :
> Hi Guys,
>
> I have to upload multiple images from single ImageField and i have tried
> everything however i am able to select only single image .
>
> Please help how can i do this?
>
> Thanks in advance
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2a0b425b-bba2-4a1f-a279-98e645e5f862%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEuG%2BTYfZWToa7QzypVXfnmEb4OU5WhW5EM5fAEuBrZESy1Urg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


multiple file upload from image filed in django admin

2017-02-04 Thread Amit Pathak
Hi Guys,

I have to upload multiple images from single ImageField and i have tried 
everything however i am able to select only single image .

Please help how can i do this?

Thanks in advance 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2a0b425b-bba2-4a1f-a279-98e645e5f862%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple file upload crashes dev server

2007-03-21 Thread Caz


> OK, I'm impressed. :-)
>
> Nice job thinking through all the things it might be and thinking of
> horses, not zebras.
>
> Malcolm

A happy confluence of unrelated events should get the credit tho: work
frustration turning into determination to be useful to someone and
discovering my new Dell has the nerve to beep at me even with the
volume muted :)


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Multiple file upload crashes dev server

2007-03-20 Thread Malcolm Tredinnick

On Tue, 2007-03-20 at 07:48 +, Caz wrote:
> Hi Lorenzo
> 
> I suspect its not that you are uploading 2 files, but which files u
> upload.
> 
> The line
> print "%s %s %s %s" % (k, new_data[k]["filename"],new_data[k]["content-
> type"], new_data[k]["content"])
> Will print the actual content of the file you are uploading.
> 
> Now if thats an image or binary file the char \x07 will appear in it.
> Which is system beep.(Printing char \x07 will make windows beep, Dell
> does not play nicely with system beep, no way to mute it, I know, I
> have one.)
> 
> So with many \x07 chars in the content you system is going to look
> like its hanging beeping like crazy until its beeped its way through
> the files you are uploading.

OK, I'm impressed. :-)

Nice job thinking through all the things it might be and thinking of
horses, not zebras.

Malcolm



--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Multiple file upload crashes dev server

2007-03-20 Thread [EMAIL PROTECTED]

On Mar 20, 8:48 am, "Caz" <[EMAIL PROTECTED]> wrote:
> Hi Lorenzo
>
> I suspect its not that you are uploading 2 files, but which files u
> upload.
>
> The line
> print "%s %s %s %s" % (k, new_data[k]["filename"],new_data[k]["content-
> type"], new_data[k]["content"])
> Will print the actual content of the file you are uploading.
>
> Now if thats an image or binary file the char \x07 will appear in it.
> Which is system beep.(Printing char \x07 will make windows beep, Dell
> does not play nicely with system beep, no way to mute it, I know, I
> have one.)

Thanks Caz, this makes sense and it's confirmed by the fact that
uploading a non binary file didn't produce any beep even having the
print statement.

I've removed the print statement now and everything is fine ;-)

Thanks a lot,
L.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Multiple file upload crashes dev server

2007-03-20 Thread Caz

Hi Lorenzo

I suspect its not that you are uploading 2 files, but which files u
upload.

The line
print "%s %s %s %s" % (k, new_data[k]["filename"],new_data[k]["content-
type"], new_data[k]["content"])
Will print the actual content of the file you are uploading.

Now if thats an image or binary file the char \x07 will appear in it.
Which is system beep.(Printing char \x07 will make windows beep, Dell
does not play nicely with system beep, no way to mute it, I know, I
have one.)

So with many \x07 chars in the content you system is going to look
like its hanging beeping like crazy until its beeped its way through
the files you are uploading.

Caz

On Mar 18, 5:15 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi everybody,
>
> the following script running on the dev server with Py2.4/Win2k3
> (tested on both IE7 and FF2) crashes the dev server. The funny thing
> is that the files get actually written to the filesystem and CPU usage
> is normal.
>
> What i'm trying to do is allow uploading of an undeterminate number N
> of files, just as GMail does.
>
> The javascript part uses jquery.
>
> Thanks,
> Lorenzo
>
> template###
> {%extends "base_template.html"%}
>
> {%block content%}
>
> 
> function addImageField()
> {
> var rndName = Math.ceil(Math.abs(Math.random() * 10));
> var chunk = "Description  
"; > > $("#imagefields").append(chunk);} > > > > {%if error_msg%} > {{error_msg}} > {%endif%} > > {%if info_msg%} > {{info_msg}} > {%endif%} > > {{form.errors.as_ul}} > > > > Description {{form.description}} > {{form.myfile}} > > > > > > > > > Attach another file > > > > > > > {%endblock%} > > view### > class FileUploadForm(Form): > description = CharField(required=False) > myfile = CharField(widget=FileInput(), required=False) > > def file_upload(request): > if request.method == "POST": > new_data = request.POST.copy() > new_data.update(request.FILES) > form = FileUploadForm(new_data) > > if form.is_valid(): > for k in request.FILES.keys(): > print "%s %s %s %s" % (k, new_data[k]["filename"], > new_data[k]["content-type"], new_data[k]["content"]) > f = file("C:\\temp\\%s" % k, "wb") > try: > f.write(new_data[k]["content"]) > f.close() > except: pass > > return HttpResponse("Success") > else: > context = dict(form=form, error_msg="Upload went > bananas!") > else: > form = FileUploadForm() > context = dict(form=form) > > return render_to_response("fileupload.html", context) --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---

Re: Multiple file upload crashes dev server

2007-03-19 Thread Benjamin Slavin

You might want to throw some logging into your application (Python's
logging module). [0]  If you use logging, you'll be able to get a
better handle on where the problem is actually happening.

I've heard of the dev server crashing ungracefully when it encounters
an error, but have never seen it myself.  The reports I've heard all
end up being programmer error, not problems with Django.  Also, I've
never heard of it taking down the whole machine.

 - Ben

[0] http://docs.python.org/lib/node407.html -- the second example
writes to a file

On 3/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> On Mar 19, 1:56 am, "[EMAIL PROTECTED]"
> <[EMAIL PROTECTED]> wrote:
> > > The PC literally starts beeping like mad (it's a hardware beep that
> > > you can hear even if the speakers are off).
> >
> > I know this is going to sound like a cop-out, but it really sounds
> > like a hardware problem. There is no reason why a python script of ANY
> > kind would cause a hardware lockup as you are describing. It sounds
> > more like a memory fault. If it happens with more than one machine I
> > would be extremely impressed.
>
> It _does_ happen on more than one machine and on both WinXp and
> Win2k3. They're both Dell machines though with different hardware
>
> L.
>
>
> >
>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Multiple file upload crashes dev server

2007-03-18 Thread [EMAIL PROTECTED]

> The PC literally starts beeping like mad (it's a hardware beep that
> you can hear even if the speakers are off).
>
I know this is going to sound like a cop-out, but it really sounds
like a hardware problem. There is no reason why a python script of ANY
kind would cause a hardware lockup as you are describing. It sounds
more like a memory fault. If it happens with more than one machine I
would be extremely impressed.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Multiple file upload crashes dev server

2007-03-18 Thread [EMAIL PROTECTED]

On Mar 18, 7:40 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sun, 2007-03-18 at 15:15 +, [EMAIL PROTECTED] wrote:

> I have no idea what's going on, but "crashes the dev server" needs more
> information. Crashes with what error message? At which point in the
> process? Every time or sporadically? If you can provide some more
> descriptive symptoms, it might trigger a thought for somebody.

Hi Malcolm,

the problem is very difficult to debug because the script above, when
executed, brings down the dev server _and_ the OS with it! Everything
comes to a stall and requires a hard reboot.

This happens _all_ the time and i've now verified the same problem on
my laptop that runs WinXp SP2 with Py2.4.

The PC literally starts beeping like mad (it's a hardware beep that
you can hear even if the speakers are off).

Thanks,
Lorenzo


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Multiple file upload crashes dev server

2007-03-18 Thread Malcolm Tredinnick

On Sun, 2007-03-18 at 15:15 +, [EMAIL PROTECTED] wrote:
> Hi everybody,
> 
> the following script running on the dev server with Py2.4/Win2k3
> (tested on both IE7 and FF2) crashes the dev server. The funny thing
> is that the files get actually written to the filesystem and CPU usage
> is normal.

I have no idea what's going on, but "crashes the dev server" needs more
information. Crashes with what error message? At which point in the
process? Every time or sporadically? If you can provide some more
descriptive symptoms, it might trigger a thought for somebody.

Regards,
Malcolm



--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Multiple file upload crashes dev server

2007-03-18 Thread [EMAIL PROTECTED]

Hi everybody,

the following script running on the dev server with Py2.4/Win2k3
(tested on both IE7 and FF2) crashes the dev server. The funny thing
is that the files get actually written to the filesystem and CPU usage
is normal.

What i'm trying to do is allow uploading of an undeterminate number N
of files, just as GMail does.

The javascript part uses jquery.

Thanks,
Lorenzo


template###
{%extends "base_template.html"%}

{%block content%}


function addImageField()
{
var rndName = Math.ceil(Math.abs(Math.random() * 10));
var chunk = "Description  
"; $("#imagefields").append(chunk); } {%if error_msg%} {{error_msg}} {%endif%} {%if info_msg%} {{info_msg}} {%endif%} {{form.errors.as_ul}} Description {{form.description}} {{form.myfile}} Attach another file {%endblock%} view### class FileUploadForm(Form): description = CharField(required=False) myfile = CharField(widget=FileInput(), required=False) def file_upload(request): if request.method == "POST": new_data = request.POST.copy() new_data.update(request.FILES) form = FileUploadForm(new_data) if form.is_valid(): for k in request.FILES.keys(): print "%s %s %s %s" % (k, new_data[k]["filename"], new_data[k]["content-type"], new_data[k]["content"]) f = file("C:\\temp\\%s" % k, "wb") try: f.write(new_data[k]["content"]) f.close() except: pass return HttpResponse("Success") else: context = dict(form=form, error_msg="Upload went bananas!") else: form = FileUploadForm() context = dict(form=form) return render_to_response("fileupload.html", context) --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---

Re: Multiple File Upload???

2006-08-30 Thread Russell Keith-Magee
On 8/31/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
On 8/30/06, cerealito <
[EMAIL PROTECTED]> wrote:
Well No, not exactly, and that's why started this thread. If I callthose methods, only one file (the last one in the form) will getuploded and its data saved to the database. The rest of the files inthe post request seem to be lost.
You seem to have missed my point - you don't use the manipulator for Image - you use the manipulator for Description. You want the manipulator that has Image objects  edited inline. If you don't have a Description-like object, you will need to create one. Call it an ImageCollection, and attach to whatever object needs collections of images.
Replying to myself here...That said, another thread on this list has revealed some bugs that I wasn't aware of: 
http://code.djangoproject.com/ticket/2413andhttp://code.djangoproject.com/ticket/2534
So, after all that, the edit-inline thing I've been talking about might not work... Russ Magee %-)

--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---


Re: Multiple File Upload???

2006-08-30 Thread Russell Keith-Magee
On 8/30/06, cerealito <[EMAIL PROTECTED]> wrote:
Well No, not exactly, and that's why started this thread. If I callthose methods, only one file (the last one in the form) will getuploded and its data saved to the database. The rest of the files inthe post request seem to be lost.
You seem to have missed my point - you don't use the manipulator for Image - you use the manipulator for Description. You want the manipulator that has Image objects  edited inline. If you don't have a Description-like object, you will need to create one. Call it an ImageCollection, and attach to whatever object needs collections of images.
The problem relies on the fact that FormWrapper seems to be associatedto one manipulator, and that the manipulator is in turn created by
AddManipulator(), a method from each Model. The Image model would haveto have multiple ImageField fields so that django can save them all,but anyways that would create *a single Image Object*
 Hence, a single ImageCollection object, tied to a single FormWrapper and manipulator.Yours,Russ Magee %-)

--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---


Re: Multiple File Upload???

2006-08-30 Thread cerealito

Ok, as a reminder, here is the Image model I am using:

class Image(models.Model):
altText = models.CharField(maxlength = 128, null = True, blank =
True)
picture = models.ImageField(upload_to='img/%Y/%m')

The problem is that i want to create multiple objects of this type from
a single upload form (and thus uploading multiple files)

> Your request appears to have multiple files in it, which suggests that your
> template is working fine. As far as I can see, all that remains is to pass
> your request into the Description Manipulator to get_validation_errors,
> do_html2python, and save. This process should handle writing the files to
> disk.

Well No, not exactly, and that's why started this thread. If I call
those methods, only one file (the last one in the form) will get
uploded and its data saved to the database. The rest of the files in
the post request seem to be lost.

The problem relies on the fact that FormWrapper seems to be associated
to one manipulator, and that the manipulator is in turn created by
AddManipulator(), a method from each Model. The Image model would have
to have multiple ImageField fields so that django can save them all,
but anyways that would create *a single Image Object*

So Apparently, if i want to upload multiple files and create with them
an equal number of Image objects, it seems to me that i have to do it
"one by one" (an upload for each post request).

I will try by creating multiple FormWrappers, but I think that will
imply knowing how many files will be uploaded, which is not exactly
cool.

Anyways, thanks a lot for your replies. I will keep trying and let you
know what i found.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Multiple File Upload???

2006-08-29 Thread Russell Keith-Magee
On 8/29/06, cerealito <[EMAIL PROTECTED]
> wrote:
Is there anyway that i can catch those and pass them to djangoManipulator'sdo_html2python() and save() methods?Your request appears to have multiple files in it, which suggests that your template is working fine. As far as I can see, all that remains is to pass your request into the Description Manipulator to get_validation_errors, do_html2python, and save. This process should handle writing the files to disk.
BTW: Re _javascript_ - I was only suggesting _javascript_ that if you want a really fancy Gmail-esque UI. _javascript_ won't help you save multiple files, it will only make the interface for specifying them a little more Web 
2.0.Yours,Russ Magee %-) 

--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---


Re: Multiple File Upload???

2006-08-29 Thread Russell Keith-Magee
On 8/29/06, cerealito <[EMAIL PROTECTED]> wrote:
Isn't there a way to upload as many files as i want to (much like gmailhandles attatchments)and then associating them to the descriptions?Try this:class Description(models.Model):
    text = models.CharField(maxlength=100)    class Admin:    pass        class Image(models.Model):    altText = models.CharField(maxlength=128, null=True, blank=True, core=True)    picture = 
models.FileField(upload_to='images', core=True)    description = models.ForeignKey(Description, edit_inline=True)and look at description in the admin view. Is that what you are after?By this model, every Image belongs to a single Description (so a description can have multiple images). Image is edited inline, so you get a list of images to add. It isn't quite as dynamic as GMail (you need some AJAX magic for that), but it's the functional part of the solution.
Yours, Russ Magee %-)

--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---


Re: Multiple File Upload???

2006-08-29 Thread cerealito

Ok, the problem then is, that my model has just a single entity called
picture.
What I'm trying to do is asociate multiple image files to multiple
`descriptions'.
I'm doing this by a intermedaite table:

#Images to be used in descriptions
class Image(models.Model):
altText = models.CharField(maxlength = 128, null = True, blank =
True)
picture = models.ImageField(upload_to='img/%Y/%m')
...

# Replaces the Many-to-Many Relationship
class ImageInDescription(models.Model):
description = models.ForeignKey(Description,
edit_inline=models.TABULAR, num_in_admin=3)
image = models.ForeignKey(Image, core = True)
...

#Descriptions
class Description(models.Model):
lang = models.ForeignKey(Lang)
description = models.TextField(null = True, blank = True)
...

That's it. So as you can see in the first class, `Image' is itself an
element to be uploaded. I guess I could add more ImageFields to the
model but that would't make sense, would it?

Isn't there a way to upload as many files as i want to (much like gmail
handles attatchments)
and then associating them to the descriptions?

Russell Keith-Magee wrote:
> On 8/29/06, cerealito <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hi everyone,
> >
> > I am trying to upload multiple image files in one of my projects.
> > Single-File upload works fine, but how do I Get to upload many files in
> > the same form?
>
> ...
>
> > But my question is... How do I "save" them?
> >
> > imageManipulator.do_html2python(new_data)
> > imageManipulator.save(new_data)
> >
> > Wouldn't work...
>
>
> It should do. As long as your model contains multiple FileField entries, the
> manipulator should quite happily save the files, one file per file field per
> form. Can you share your actual model, view and template (or pruned versions
> of them)?
>
> Yours,
> Russ Magee %-)
>
> --=_Part_61688_22258181.1156811004015
> Content-Type: text/html; charset=ISO-8859-1
> X-Google-AttachSize: 1132
>
> On 8/29/06,  class="gmail_sendername">cerealito mailto:[EMAIL 
> PROTECTED]">[EMAIL PROTECTED] wrote: class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 
> 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> Hi everyone,I am trying to upload 
> multiple image files in one of my projects.Single-File upload works fine, 
> but how do I Get to upload many files inthe same 
> form?...
> But my question is... How do I save 
> them?imageManipulator.do_html2python(new_data)imageManipulator.save(new_data)Wouldn't
>  work...It should do.  As long as your model contains 
> multiple FileField entries, the manipulator should quite happily save the 
> files, one file per file field per form. Can you share your actual model, 
> view and template (or pruned versions of them)?
> Yours,Russ Magee %-)
> 
> --=_Part_61688_22258181.1156811004015--


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Multiple File Upload???

2006-08-28 Thread Russell Keith-Magee
On 8/29/06, cerealito <[EMAIL PROTECTED]> wrote:
Hi everyone,I am trying to upload multiple image files in one of my projects.Single-File upload works fine, but how do I Get to upload many files inthe same form?...
But my question is... How do I "save" them?imageManipulator.do_html2python(new_data)imageManipulator.save(new_data)Wouldn't work...It should do.  As long as your model contains multiple FileField entries, the manipulator should quite happily save the files, one file per file field per form. Can you share your actual model, view and template (or pruned versions of them)?
Yours,Russ Magee %-)

--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---


Multiple File Upload???

2006-08-28 Thread cerealito

Hi everyone,

I am trying to upload multiple image files in one of my projects.
Single-File upload works fine, but how do I Get to upload many files in
the same form?

I have many of these in the templates:
{{ form.picture }} {{ form.picture_file }}

Then on my views i have:
for file in request.FILES.getlist('picture_file'):
print( file )# i can see the dictonary-like
objects in the server output...

But my question is... How do I "save" them?

imageManipulator.do_html2python(new_data)
imageManipulator.save(new_data)

Wouldn't work...

Can anybody point me into the right direction? I've been browsing
through the docs and I couldn't find any useful info. I'm sure someone
has already passed through this. I would really appreciate any clue.

Thanks in advance.

Django Fan and Newbie #6134


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---