Django的+ GWT和jQuery的Django、GWT、jQuery

2023-09-10 13:16:33 作者:风的森林

我已经做了一个复杂的模型结构,Django的。我本来计划使使用GWT这种结构,但与蟒蛇的选项进行交流白衣它是:   - 使用JSON在这种情况下,我不得不重复的模型结构的JavaScript对象(见GWT教程)。   - 蟒蛇-GWT-RPC与GWT兼容的远程过程调用的库,但在我看来,这不是容易与Django的模型集成和过时的文件并没有帮助我

I have made a complex models structure in django. I had planned to render this structure using GWT, but with python the option to communicate whit it are: - using JSON and in this case I have to duplicate the models structure in javascript objects (see gwt tutorial). - python-gwt-rpc is a remote procedure call library compatible with gwt, but it seems to me that it's not easy to integrate with django models, and the outdated documentation doesn't help me.

我在考虑是使用Django的模板系统来呈现我的网页有一些jQuery UI插件的替代,在这种建议的方法post以retriving HTML数据,而无需处理JSON对象,因为我认为这与它打交道是一场噩梦,因为在我的结构,当数据变化也界面可以drammatically改变。

The alternative I considering is using the Django template system to render my pages with some Jquery UI plugins and the method suggested in this post to retriving html data without deal with JSON objects because I think that dealing with it is a nightmare because in my structure when the data changes also the interface could be drammatically change.

所以,我认为,随着GWT我要重复的JavaScript对象Django的模型,但我已经通过了Java子类的系统支持。在第二个解决办法,我再利用Django的模型,并使用Django的模板系统,然后我能够使服务器端的检查,但既不是一个很酷的GWT接口,无论是轻巧的Json调用更新的页面。

So I think that with GWT I have to duplicate the django models in javascript objects but I have supported by the java subclasses system. In the second solution I reuse the django models and use the django template system then I able to make server side check, but neither a cool GWT interface neither the lightweight Json call to update pages.

什么是对这个问题Offer实用例句方法?

What is yuor approach on this issue?

推荐答案

你有没有考虑睡衣?

对于我来说,这是两全其美。您可以使用,像往常一样,Django的后端,但可以很容易地从你的睡衣code使用JSON RPC服务。

For me, it's the best of both worlds. You use, as usual, the Django back-end but can easily use JSON RPC services from your pyjamas code.

您$ C C前端pretty的很像GWT $,但在Python,而不是Java的。

You code the front-end pretty much like in GWT, but in Python instead of Java.

下面是一个简短的教程:http://gdwarner.blogspot.com/2008/10/brief-pyjamas-django-tutorial.html

Here is a brief tutorial: http://gdwarner.blogspot.com/2008/10/brief-pyjamas-django-tutorial.html