Title: save 的行为和 JS SDK 不一致 · Issue #489 · leancloud/python-sdk · GitHub
Open Graph Title: save 的行为和 JS SDK 不一致 · Issue #489 · leancloud/python-sdk
X Title: save 的行为和 JS SDK 不一致 · Issue #489 · leancloud/python-sdk
Description: const d = await new AV.Query('TestObject').get('5f27bc73fbb489000824300d') console.log(d.get('testList')) listData = d.get('testList') listData.push('debug') await d.save() 上面这段 JS 代码,最终云端的 testList 会包含 debug 这个值,但是等效的 Python 代码,testList...
Open Graph Description: const d = await new AV.Query('TestObject').get('5f27bc73fbb489000824300d') console.log(d.get('testList')) listData = d.get('testList') listData.push('debug') await d.save() 上面这段 JS 代码,最终云端的 testLis...
X Description: const d = await new AV.Query('TestObject').get('5f27bc73fbb489000824300d') console.log(d.get('testList')) listData = d.get('testList') listData.push('debug')...
Opengraph URL: https://github.com/leancloud/python-sdk/issues/489
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"save 的行为和 JS SDK 不一致","articleBody":"```js\r\nconst d = await new AV.Query('TestObject').get('5f27bc73fbb489000824300d')\r\nconsole.log(d.get('testList'))\r\nlistData = d.get('testList')\r\nlistData.push('debug')\r\nawait d.save()\r\n```\r\n\r\n上面这段 JS 代码,最终云端的 `testList` 会包含 `debug` 这个值,但是等效的 Python 代码,`testList` 并不会包含 `debug` 这个值。 python SDK 的 save 没有 JS SDK 的这么智能。python SDK 只有在调用 set 方法(或 `add_unique` 之类的类 set 方法时才会更新内部维护的 `_changes` 状态,最终在 save 时将更新发送给云端)。python SDK 的行为实现上更简单,但可能导致用户感到困惑。下一个大版本需要考虑是否需要把行为改成和 JS SDK 一致。\r\n\r\n相关论坛帖子 [23120](https://forum.leancloud.cn/t/python-sdk-list-dict-set/23120/) ","author":{"url":"https://github.com/weakish","@type":"Person","name":"weakish"},"datePublished":"2020-08-03T09:52:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/489/python-sdk/issues/489"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:52ba9415-8b84-ce8f-c40f-350891e87d6d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C842:E9F42:10EE55:16982D:6977BD70 |
| html-safe-nonce | de49d68cfcc95822cb74e20c69302d2957f74ec1748cb049ced70169c31bf755 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODQyOkU5RjQyOjEwRUU1NToxNjk4MkQ6Njk3N0JENzAiLCJ2aXNpdG9yX2lkIjoiNDE1MDQ3NTQxMDk5Njk2ODgxNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 949192d8865cabe68ab521d75332296391a3bca8a52d48b757a709b9170e80e0 |
| hovercard-subject-tag | issue:671952013 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/leancloud/python-sdk/489/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1e4ee0a730256576e3672b59fb2b853f1ee053e8393677a53955504537120958/leancloud/python-sdk/issues/489 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1e4ee0a730256576e3672b59fb2b853f1ee053e8393677a53955504537120958/leancloud/python-sdk/issues/489 |
| og:image:alt | const d = await new AV.Query('TestObject').get('5f27bc73fbb489000824300d') console.log(d.get('testList')) listData = d.get('testList') listData.push('debug') await d.save() 上面这段 JS 代码,最终云端的 testLis... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | weakish |
| hostname | github.com |
| expected-hostname | github.com |
| None | 831218810e1b66a41a0626c8c15f7f47625846d9a7516c7f43cfc2c61effad83 |
| turbo-cache-control | no-preview |
| go-import | github.com/leancloud/python-sdk git https://github.com/leancloud/python-sdk.git |
| octolytics-dimension-user_id | 6660518 |
| octolytics-dimension-user_login | leancloud |
| octolytics-dimension-repository_id | 26794168 |
| octolytics-dimension-repository_nwo | leancloud/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 26794168 |
| octolytics-dimension-repository_network_root_nwo | leancloud/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b37ffa89d073c0d4a6f07ff42d59120741a74955 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width