Gath,
Attached at the end of this email an exchange from a few months back
about Dojo & Django using the dojango application.
I've been using this and have been happy with it.
http://code.google.com/p/dojango/
Rob
On Apr 2, 2009, at 7:55 AM, Dougal Matthews wrote:
> It kinds depends what you want to do really.
>
> JavaScript is run inside the browser and Django is running on your
> website. So it doesn't even know what Django or Python is, however
> they can communicate and pass data.
>
> By using it with Django, do you mean you want to do some Ajax stuff?
> If that's the case then you will want to decide how you are going to
> pass data. You can then just make your views return the appropriate
> data, be that chunks of HTML, JSON or XML etc.
>
> Dougal
>
> ---
> Dougal Matthews - @d0ugal
> http://www.dougalmatthews.com/
>
>
>
> 2009/4/2 Gath <[email protected]>
>
> All,
>
> I have downloaded Dojo 1.3, i want to start sampling some examples in
> the Dojo website using Django, where do i place the package? How do i
> call it in my template?
>
> Gath
>
>
>
> >
On Nov 2, 2008, at 12:42 AM, Wolfram Kriesing wrote:
>
> awesome :-)
> Glad I could help.
> Feel free to ask anything, I will try to help!
>
> --
> cu
>
> Wolfram
>
> http://uxebu.com - web consultancy
> You need AJAX, RIA, JavaScript and all this modern stuff? We got it!
>
>
>
> On Sun, Nov 2, 2008 at 1:14 AM, Rob Goedman <[email protected]> wrote:
>>
>> Wolfram,
>>
>> You bet I've read your blogs! Wouldn't have gotten where I got to
>> without them!
>>
>> Clearly I had missed the to_dojo_data(), that's exactly what I was
>> looking for.
>>
>> This works super.
>>
>> Thanks a lot,
>> Rob
>>
>> On Nov 1, 2008, at 4:45 PM, Wolfram Kriesing wrote:
>>
>>>
>>> Hi Rob,
>>>
>>> aehm, maybe what you were looking for was this:
>>>
>>> @json_response
>>> def send_toxids_list(request):
>>> ret = Toxid.objects.all()
>>> return to_dojo_data(ret, identifier='docno')
>>>
>>> the json_response decorator takes care of extrcting only the
>>> fields form the model, you dont have to do this
>>> by hand. And the to_dojo_data() function converts the
>>> data into a dojo.data store compatible format.
>>>
>>> See also this blog post about more info
>>> about the json_response decorator/function
>>> and insight details.
>>> http://wolfram.kriesing.de/blog/index.php/2007/json-serialization-for-django
>>>
>>>
>>> --
>>> cu
>>>
>>> Wolfram
>>>
>>> http://uxebu.com - the AJAX experts
>>> You need AJAX, RIA, JavaScript and all this modern stuff? We got it!
>>
>>
>>> On Nov 1, 2008, at 4:34 PM, Wolfram Kriesing wrote:
>>>>
>>>> Hi Rob,
>>>>
>>>> did you see the blog article
>>>> http://blog.uxebu.com/2008/07/26/ajax-with-dojango/
>>>> and the examples in
>>>> http://code.google.com/p/dojango/source/browse/trunk/dojango/views.py
>>>>
>>>> tbh I don't really understand what you are using the JSON
>>>> serializer for.
>>>> Could you may be explain, if the links above dont help?
>>>>
>>>> --
>>>> cu
>>>>
>>>> Wolfram
>>>>
>>>> http://uxebu.com - the AJAX experts
>>>> You need AJAX, RIA, JavaScript and all this modern stuff? We got
>>>> it!
>>
>>
>>>> On Sat, Nov 1, 2008 at 11:31 PM, Rob Goedman <[email protected]>
>>>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> Just for Django & Dojo users.
>>>>
>>>> Working through the 'Mastering Dojo' book, updating the examples
>>>> where
>>>> applicable to Dojo 1.2 (i.e. grids) and making them work with
>>>> Django
>>>> svn has gone pretty smoothly. I wonder if below method is a
>>>> reasonable
>>>> way to generate fairly generic xhr* responses?
>>>>
>>>> I use something like (e.g. from the dojo.data chapter on
>>>> QueryReadStore):
>>>>
>>>> @json_response
>>>> def send_toxids_list(request):
>>>> """
>>>> Creates a JSON/Dojo hash with the filtered contents
>>>> for a grid. This method is called by Dojo xhr*.
>>>>
>>>> To do:
>>>>
>>>> 1) Change ...all() into ...filter()
>>>> according to qDict info.
>>>>
>>>> """
>>>>
>>>> qDict = request.GET
>>>> print qDict['user'], qDict.get('query', None)
>>>>
>>>> queryset = Toxid.objects.all()
>>>> json_serializer = serializers.get_serializer("json")()
>>>> toxids_json = json_serializer.serialize(queryset,
>>>> ensure_ascii=True)
>>>> t = eval(toxids_json)
>>>> a = []
>>>> for i in t: a.append(i['fields'])
>>>> ret = {
>>>> "identifier": "docno",
>>>> "label": "substance",
>>>> "items": a,
>>>> }
>>>> return ret
>>>>
>>>> It seems a frequently recurring pattern in my views, so I would
>>>> like
>>>> to do it right and efficient. Particularly the 'eval' step feels
>>>> weird.
>>>>
>>>> I did have a look at dojox.dtl (Django Templating Language) but
>>>> haven't (yet?) figured out if that is applicable for this.
>>>>
>>>> Thanks,
>>>> Rob
>>>>
>>>>
>>>>
>>>>>
>>>>
>>>
>>>>
>>
>>
>>>
>>
>
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to [email protected]
> 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
> -~----------~----~----~----~------~----~------~--~---
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---