本地字段列表在 Django-piston 中未正确覆盖

发布于 2024-12-28 05:31:32 字数 342 浏览 1 评论 0原文

有没有人遇到过这个问题,但是在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

束缚m 2025-01-04 05:31:32

我使用 django-piston 已经很长时间了。当您指定 model = Foo 时,会出现一些问题。我只是用它来组织 Web 服务的 url、OAuth 和 Django 身份验证。我仍然没有任何问题(还)。如果您没有任何特殊原因使用 model = Foofields 我认为您可以在 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 use model = Foo and fields I think you can call the model within read and create.
Hope it help :)

我三岁 2025-01-04 05:31:32

如果您不想自己应用补丁,并且不想避免在处理程序上使用某些模型引用来解决该问题,那么也许只需克隆包含被推送到主存储库的补丁的活塞叉:

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文