PendingDeprecation在django / tastypie上警告 [英] PendingDeprecationWarning on django / tastypie

查看:172
本文介绍了PendingDeprecation在django / tastypie上警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用tastypie设置一个非常简单的REST服务示例,但是我收到了PendingDeprecationWarning。

I am trying to set a pretty straightforward example of a REST service using tastypie, however I am getting a PendingDeprecationWarning.

这是浏览器上出现的错误信息

Here is the error message appearing on the browser

Request Method: GET
Request URL:    http://127.0.0.1:8000/myapp/api/myapp_resource
Django Version: 1.6.2
Exception Type: PendingDeprecationWarning
Exception Value:    
commit_on_success is deprecated in favor of atomic.
Exception Location: /home/pkaramol/Workspace/django-env/lib/python3.3/site-packages/django/db/transaction.py in commit_on_success, line 448
Python Executable:  /home/pkaramol/Workspace/django-env/bin/python3
Python Version: 3.3.2
Python Path:    
['/home/pkaramol/Workspace/django-env/restserver',
 '/home/pkaramol/Workspace/django-env/lib/python3.3',
 '/home/pkaramol/Workspace/django-env/lib/python3.3/plat-x86_64-linux-gnu',
 '/home/pkaramol/Workspace/django-env/lib/python3.3/lib-dynload',
 '/usr/lib/python3.3',
 '/usr/lib/python3.3/plat-x86_64-linux-gnu',
 '/home/pkaramol/Workspace/django-env/lib/python3.3/site-packages']

我使用的是tastypie 0.11.0

I am using tastypie 0.11.0

没有太多的关于这个错误的文档或其他报告(警告),所以我想请求有关如何处理的建议。

There is not much of a documentation or other reports regarding this error (warning rather) so I would like to ask for suggestions on how to go about it.

推荐答案

p>镨oblem似乎可以通过更改文件resources.py文件中的 patch_list()方法(第2190行)的装饰器来解决

Problem seems to be solved by changing the decorator of patch_list() method (line 2190) in file resources.py file of tastypie

@ transaction.commit_on_success()

@ transaction.atomic ()

这篇关于PendingDeprecation在django / tastypie上警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆