python-sdk
python-sdk copied to clipboard
LeanCloud Python SDK
https://github.com/psf/black/releases/tag/22.1.0 因为目前 Python SDK 还支持 Python 2,所以需要找替代品,或者暂时用旧版的 black
比如以下代码会出错: ```python Author = leancloud.Object.extend('Author') author = Author() author.name = "Bob" Post = leancloud.Object.extend('Post') post = Post() post.set('title', 'hugry') post.set('content', 'where to eat') post.set('author', author) Comment = leancloud.Object.extend('Comment') comment =...
1. Python 2 已于 2020 年 1 月 1 号 EOL;未来 Python 3.10 还会移除一些兼容 Python 2 的特性 2. SDK 用的依赖也逐渐开始停止支持 Python 2,比如 gevent 1.5 官方说不支持 python 3.8 的(不过目前在 3.8 下跑单元测试能跑过,但不确定会不会有边角问题),而支持...
参考代码 2.9.3 版本:https://github.com/leancloud/python-sdk/blob/v2.9.3/leancloud/query.py#L117 ```python query = Query(queries[0]._query_class._class_name) ``` 1. 不应该使用 Query 声明新的对象,而应该使用 cls 来声明,否则会导致继承 Query 得来的 MyQuery 类的 or_ 方法和 and_ 方法返回父类声明的实例。 ```python In [1]: from leancloud import Query In...
This is consistent with `query.first`. Thank [artsungames] for bringing this to our attention. [artsungames]: https://forum.leancloud.cn/t/python-get-id-null/24104
ref: [leancloud/cloud-code#1451](https://github.com/leancloud/cloud-code/issues/1451)
目前 Node.js SDK 有这样的功能: ```js env DEBUG=leancloud:request:error lean up ```
无法直接通过 `__init__` 方法还原一个 dump 出来的数据,所以自己做了一个: ```python class Object: @classmethod def load(cls, attrs): obj, meta_date = cls(), dict() for k in ("createdAt", "updatedAt"): v = attrs.pop(k, None) if v is not...