Re: Return 2 values

2013-07-09 Thread Masklinn
On 2013-07-08, at 13:26 , Hélio Miranda wrote: > ok, I have my view like this: > *def view(request, id):* > *fs = mongoengine.fields.GridFSProxy()* > *foto = fs.get(id=ObjectId(id))* > *legenda = foto.legend* > ** > *array = [foto.read(), legenda]* > *return HttpResponse(arr

Re: Return 2 values

2013-07-08 Thread Nick Apostolakis
On 08/07/2013 02:26 μμ, Hélio Miranda wrote: ok, I have my view like this: *def view(request, id):* *fs = mongoengine.fields.GridFSProxy()* *foto = fs.get(id=ObjectId(id))* *legenda = foto.legend* ** *array = [foto.read(), legenda]* *return HttpResponse(array)* But before

Re: Return 2 values

2013-07-08 Thread Hélio Miranda
ok, I have my view like this: *def view(request, id):* *fs = mongoengine.fields.GridFSProxy()* *foto = fs.get(id=ObjectId(id))* *legenda = foto.legend* ** *array = [foto.read(), legenda]* *return HttpResponse(array)* But before I had to go to the image url this: *url(r'^vie

Re: Return 2 values

2013-07-05 Thread Nick Apostolakis
On 05/07/2013 02:27 μμ, Nick Apostolakis wrote: You should be fine everything is an object so you can hold different datatypes in a list As a reference, check this out http://zetcode.com/lang/python/datatypes/ in the tuple and lists section and this http://stackoverflow.com/questions/1

Re: Return 2 values

2013-07-05 Thread Nick Apostolakis
You should be fine everything is an object so you can hold different datatypes in a list Στις 05 Ιουλ 2013 1:26 ΜΜ, ο χρήστης "Hélio Miranda" έγραψε: My problem is that I am returning an image (content_type = 'image / jpeg') and the legend is not an image but text -- You received this messag

Re: Return 2 values

2013-07-05 Thread Hélio Miranda
My problem is that I am returning an image (content_type = 'image / jpeg') and the legend is not an image but text -- 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

Re: Return 2 values

2013-07-05 Thread Nick Apostolakis
I am not in front of a computer right now in order to offer a full fledged examle, but you can insert your values in a dictionary or a list and return that Στις 05 Ιουλ 2013 12:54 ΜΜ, ο χρήστης "Hélio Miranda" έγραψε: can you give me an example? -- You received this message because you are s

Re: Return 2 values

2013-07-05 Thread Hélio Miranda
can you give me an example? -- 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 djang

Re: Return 2 values

2013-07-05 Thread Nick Apostolakis
You can always return a container object with the values you want as it's instance variables Στις 05 Ιουλ 2013 12:39 ΜΜ, ο χρήστης "Hélio Miranda" έγραψε: Hi My doubt is that I am not getting an image and its caption. I'll explain, I have my application to enter the picture and the caption GridF

Re: Return 2 values

2013-07-05 Thread Sergiy Khohlov
try to use dict with 2 items Many thanks, Serge +380 636150445 skype: skhohlov On Fri, Jul 5, 2013 at 12:38 PM, Hélio Miranda wrote: > Hi > My doubt is that I am not getting an image and its caption. > I'll explain, I have my application to enter the picture and the caption > GridFS on mo