本地字段列表在 Django-piston 中未正确覆盖
有没有人遇到过这个问题,但是在 Django-piston 中不允许你覆盖已经设置的字段?
https://bitbucket.org/jespern /django-piston/issue/192/object-handler-fields-override-local-field
任何人都可以帮我解决问题吗?我看到有一个简单的补丁,但我不想进去更改活塞中的代码。有办法解决吗?
Has anyone experience issues with this but in Django-piston that doesn't allow you to override fields already set?
https://bitbucket.org/jespern/django-piston/issue/192/object-handler-fields-override-local-field
Can anyone help me with a work around? I saw there is an easy patch but I don't want to go in and change the code in piston. Is there a way around it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用 django-piston 已经很长时间了。当您指定
model = Foo
时,会出现一些问题。我只是用它来组织 Web 服务的 url、OAuth 和 Django 身份验证。我仍然没有任何问题(还)。如果您没有任何特殊原因使用model = Foo
和fields
我认为您可以在 read 和 create 中调用模型。希望它有帮助:)
I'm using django-piston for quite a long time. There are a couple of issues with when you specify
model = Foo.
I simply use it to organize web service's urls, OAuth and Django Authentication. I still dont have any issue with it (yet). If you dont have any special reason to usemodel = Foo
andfields
I think you can call the model within read and create.Hope it help :)
如果您不想自己应用补丁,并且不想避免在处理程序上使用某些模型引用来解决该问题,那么也许只需克隆包含被推送到主存储库的补丁的活塞叉:
https://bitbucket.org/rptirrell/django-piston/overview
取决于除此之外,只要您愿意,将其交换到主存储库也是微不足道的。
If you dont want to apply the patch yourself, and you dont want to avoid using certain model references on handlers to work around the issue, then maybe just clone the fork of piston that contains the patch being pushed to the main repo:
https://bitbucket.org/rptirrell/django-piston/overview
Its up to date aside from that and its trivial to swap it out to the main repo whenever you want.