From 1496a8493f24f9141335cbecd340711997f868a6 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 23 Sep 2025 15:21:59 +1200 Subject: [PATCH] Add order random --- appwrite/client.py | 4 ++-- appwrite/query.py | 4 ++++ appwrite/services/tables_db.py | 2 +- docs/examples/databases/create-line-attribute.md | 2 +- docs/examples/databases/create-point-attribute.md | 2 +- docs/examples/databases/create-polygon-attribute.md | 2 +- docs/examples/databases/update-line-attribute.md | 2 +- docs/examples/databases/update-point-attribute.md | 2 +- docs/examples/databases/update-polygon-attribute.md | 2 +- docs/examples/tablesdb/create-line-column.md | 2 +- docs/examples/tablesdb/create-point-column.md | 2 +- docs/examples/tablesdb/create-polygon-column.md | 2 +- docs/examples/tablesdb/update-line-column.md | 2 +- docs/examples/tablesdb/update-point-column.md | 2 +- docs/examples/tablesdb/update-polygon-column.md | 2 +- setup.py | 4 ++-- 16 files changed, 21 insertions(+), 17 deletions(-) diff --git a/appwrite/client.py b/appwrite/client.py index caa1f4b..e23845e 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -14,11 +14,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/13.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/13.1.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '13.0.0', + 'x-sdk-version': '13.1.0', 'X-Appwrite-Response-Format' : '1.8.0', } diff --git a/appwrite/query.py b/appwrite/query.py index a0127e5..a601eec 100644 --- a/appwrite/query.py +++ b/appwrite/query.py @@ -79,6 +79,10 @@ def order_asc(attribute): def order_desc(attribute): return str(Query("orderDesc", attribute, None)) + @staticmethod + def order_random(): + return str(Query("orderRandom", None, None)) + @staticmethod def cursor_before(id): return str(Query("cursorBefore", None, id)) diff --git a/appwrite/services/tables_db.py b/appwrite/services/tables_db.py index 4bf5cc2..f6d3613 100644 --- a/appwrite/services/tables_db.py +++ b/appwrite/services/tables_db.py @@ -2337,7 +2337,7 @@ def create_rows(self, database_id: str, table_id: str, rows: List[dict]) -> Dict table_id : str Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows. rows : List[dict] - Array of documents data as JSON objects. + Array of rows data as JSON objects. Returns ------- diff --git a/docs/examples/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md index ccb8fec..c61be8f 100644 --- a/docs/examples/databases/create-line-attribute.md +++ b/docs/examples/databases/create-line-attribute.md @@ -13,5 +13,5 @@ result = databases.create_line_attribute( collection_id = '', key = '', required = False, - default = [[1,2], [3, 4]] # optional + default = [[1, 2], [3, 4], [5, 6]] # optional ) diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md index f0b1f2d..7acdb94 100644 --- a/docs/examples/databases/create-point-attribute.md +++ b/docs/examples/databases/create-point-attribute.md @@ -13,5 +13,5 @@ result = databases.create_point_attribute( collection_id = '', key = '', required = False, - default = [[1,2], [3, 4]] # optional + default = [1, 2] # optional ) diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md index dec3111..c727b71 100644 --- a/docs/examples/databases/create-polygon-attribute.md +++ b/docs/examples/databases/create-polygon-attribute.md @@ -13,5 +13,5 @@ result = databases.create_polygon_attribute( collection_id = '', key = '', required = False, - default = [[1,2], [3, 4]] # optional + default = [[[1, 2], [3, 4], [5, 6], [1, 2]]] # optional ) diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md index 9bd33e6..b1804f6 100644 --- a/docs/examples/databases/update-line-attribute.md +++ b/docs/examples/databases/update-line-attribute.md @@ -13,6 +13,6 @@ result = databases.update_line_attribute( collection_id = '', key = '', required = False, - default = [[1,2], [3, 4]], # optional + default = [[1, 2], [3, 4], [5, 6]], # optional new_key = '' # optional ) diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md index 90f2df5..58def4b 100644 --- a/docs/examples/databases/update-point-attribute.md +++ b/docs/examples/databases/update-point-attribute.md @@ -13,6 +13,6 @@ result = databases.update_point_attribute( collection_id = '', key = '', required = False, - default = [[1,2], [3, 4]], # optional + default = [1, 2], # optional new_key = '' # optional ) diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md index 07d1747..c3625fe 100644 --- a/docs/examples/databases/update-polygon-attribute.md +++ b/docs/examples/databases/update-polygon-attribute.md @@ -13,6 +13,6 @@ result = databases.update_polygon_attribute( collection_id = '', key = '', required = False, - default = [[1,2], [3, 4]], # optional + default = [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional new_key = '' # optional ) diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md index 82482b3..1159123 100644 --- a/docs/examples/tablesdb/create-line-column.md +++ b/docs/examples/tablesdb/create-line-column.md @@ -13,5 +13,5 @@ result = tables_db.create_line_column( table_id = '', key = '', required = False, - default = [[1,2], [3, 4]] # optional + default = [[1, 2], [3, 4], [5, 6]] # optional ) diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md index 9d866aa..8f51e95 100644 --- a/docs/examples/tablesdb/create-point-column.md +++ b/docs/examples/tablesdb/create-point-column.md @@ -13,5 +13,5 @@ result = tables_db.create_point_column( table_id = '', key = '', required = False, - default = [[1,2], [3, 4]] # optional + default = [1, 2] # optional ) diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md index 94877f1..cf4540e 100644 --- a/docs/examples/tablesdb/create-polygon-column.md +++ b/docs/examples/tablesdb/create-polygon-column.md @@ -13,5 +13,5 @@ result = tables_db.create_polygon_column( table_id = '', key = '', required = False, - default = [[1,2], [3, 4]] # optional + default = [[[1, 2], [3, 4], [5, 6], [1, 2]]] # optional ) diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md index c59681d..2f02b61 100644 --- a/docs/examples/tablesdb/update-line-column.md +++ b/docs/examples/tablesdb/update-line-column.md @@ -13,6 +13,6 @@ result = tables_db.update_line_column( table_id = '', key = '', required = False, - default = [[1,2], [3, 4]], # optional + default = [[1, 2], [3, 4], [5, 6]], # optional new_key = '' # optional ) diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md index 5901280..63fb308 100644 --- a/docs/examples/tablesdb/update-point-column.md +++ b/docs/examples/tablesdb/update-point-column.md @@ -13,6 +13,6 @@ result = tables_db.update_point_column( table_id = '', key = '', required = False, - default = [[1,2], [3, 4]], # optional + default = [1, 2], # optional new_key = '' # optional ) diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md index e936964..07118b1 100644 --- a/docs/examples/tablesdb/update-polygon-column.md +++ b/docs/examples/tablesdb/update-polygon-column.md @@ -13,6 +13,6 @@ result = tables_db.update_polygon_column( table_id = '', key = '', required = False, - default = [[1,2], [3, 4]], # optional + default = [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional new_key = '' # optional ) diff --git a/setup.py b/setup.py index 7883652..37141a8 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '13.0.0', + version = '13.1.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/13.0.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/13.1.0.tar.gz', install_requires=[ 'requests', ],