Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Jan. 24, 2011 14:56:37

nicolas l.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

model array to javascript


hello all i was wandering if its possible to pass a model.objects.filter()
array like ¨Category¨ and ¨ Sub-category ¨ to JavaScript.

this is meant to be used in a JavaScript function to fill
a Combo-box Sub-category by changing the Combo-box ¨¨Category¨

--
Saludos.

Nicolas Lubkov
Ing. Informatica de gestion

--
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
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 24, 2011 15:36:10

Patrick M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

model array to javascript


I would recommend first converting it to an intermediary format, such as
JSON or XML, as described here:http://docs.djangoproject.com/en/1.2/topics/serialization/You can then use JavaScript to easily manipulate it in whatever way you
want. This is basically the approach I take when doing AJAXy things.

HTH

On Mon, Jan 24, 2011 at 9:56 AM, nicolas lubkov <nlub...@gmail.com> wrote:

> hello all i was wandering if its possible to pass a model.objects.filter()
> array like ¨Category¨ and ¨ Sub-category ¨ to JavaScript.
>
> this is meant to be used in a JavaScript function to fill
> a Combo-box Sub-category by changing the Combo-box ¨¨Category¨
>
> --
> Saludos.
>
> Nicolas Lubkov
> Ing. Informatica de gestion
>
> --
> 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
> 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.
>

--
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
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 21st of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support