Skip to content

Commit 9911dcc

Browse files
committed
Fix spatial default
1 parent 05c9666 commit 9911dcc

17 files changed

+67
-51
lines changed

appwrite/services/databases.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ def update_ip_attribute(self, database_id: str, collection_id: str, key: str, re
13261326
'content-type': 'application/json',
13271327
}, api_params)
13281328

1329-
def create_line_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None) -> Dict[str, Any]:
1329+
def create_line_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: List[Any] = None) -> Dict[str, Any]:
13301330
"""
13311331
Create a geometric line attribute.
13321332
@@ -1342,8 +1342,8 @@ def create_line_attribute(self, database_id: str, collection_id: str, key: str,
13421342
Attribute Key.
13431343
required : bool
13441344
Is attribute required?
1345-
default : str
1346-
Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.
1345+
default : List[Any]
1346+
Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
13471347
13481348
Returns
13491349
-------
@@ -1381,7 +1381,7 @@ def create_line_attribute(self, database_id: str, collection_id: str, key: str,
13811381
'content-type': 'application/json',
13821382
}, api_params)
13831383

1384-
def update_line_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, new_key: str = None) -> Dict[str, Any]:
1384+
def update_line_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: List[Any] = None, new_key: str = None) -> Dict[str, Any]:
13851385
"""
13861386
Update a line attribute. Changing the `default` value will not update already existing documents.
13871387
@@ -1397,8 +1397,8 @@ def update_line_attribute(self, database_id: str, collection_id: str, key: str,
13971397
Attribute Key.
13981398
required : bool
13991399
Is attribute required?
1400-
default : str
1401-
Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.
1400+
default : List[Any]
1401+
Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
14021402
new_key : str
14031403
New attribute key.
14041404
@@ -1439,7 +1439,7 @@ def update_line_attribute(self, database_id: str, collection_id: str, key: str,
14391439
'content-type': 'application/json',
14401440
}, api_params)
14411441

1442-
def create_point_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None) -> Dict[str, Any]:
1442+
def create_point_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: List[Any] = None) -> Dict[str, Any]:
14431443
"""
14441444
Create a geometric point attribute.
14451445
@@ -1455,8 +1455,8 @@ def create_point_attribute(self, database_id: str, collection_id: str, key: str,
14551455
Attribute Key.
14561456
required : bool
14571457
Is attribute required?
1458-
default : str
1459-
Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.
1458+
default : List[Any]
1459+
Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
14601460
14611461
Returns
14621462
-------
@@ -1494,7 +1494,7 @@ def create_point_attribute(self, database_id: str, collection_id: str, key: str,
14941494
'content-type': 'application/json',
14951495
}, api_params)
14961496

1497-
def update_point_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, new_key: str = None) -> Dict[str, Any]:
1497+
def update_point_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: List[Any] = None, new_key: str = None) -> Dict[str, Any]:
14981498
"""
14991499
Update a point attribute. Changing the `default` value will not update already existing documents.
15001500
@@ -1510,8 +1510,8 @@ def update_point_attribute(self, database_id: str, collection_id: str, key: str,
15101510
Attribute Key.
15111511
required : bool
15121512
Is attribute required?
1513-
default : str
1514-
Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.
1513+
default : List[Any]
1514+
Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
15151515
new_key : str
15161516
New attribute key.
15171517
@@ -1552,7 +1552,7 @@ def update_point_attribute(self, database_id: str, collection_id: str, key: str,
15521552
'content-type': 'application/json',
15531553
}, api_params)
15541554

1555-
def create_polygon_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None) -> Dict[str, Any]:
1555+
def create_polygon_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: List[Any] = None) -> Dict[str, Any]:
15561556
"""
15571557
Create a geometric polygon attribute.
15581558
@@ -1568,8 +1568,8 @@ def create_polygon_attribute(self, database_id: str, collection_id: str, key: st
15681568
Attribute Key.
15691569
required : bool
15701570
Is attribute required?
1571-
default : str
1572-
Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.
1571+
default : List[Any]
1572+
Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
15731573
15741574
Returns
15751575
-------
@@ -1607,7 +1607,7 @@ def create_polygon_attribute(self, database_id: str, collection_id: str, key: st
16071607
'content-type': 'application/json',
16081608
}, api_params)
16091609

1610-
def update_polygon_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: str = None, new_key: str = None) -> Dict[str, Any]:
1610+
def update_polygon_attribute(self, database_id: str, collection_id: str, key: str, required: bool, default: List[Any] = None, new_key: str = None) -> Dict[str, Any]:
16111611
"""
16121612
Update a polygon attribute. Changing the `default` value will not update already existing documents.
16131613
@@ -1623,8 +1623,8 @@ def update_polygon_attribute(self, database_id: str, collection_id: str, key: st
16231623
Attribute Key.
16241624
required : bool
16251625
Is attribute required?
1626-
default : str
1627-
Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.
1626+
default : List[Any]
1627+
Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
16281628
new_key : str
16291629
New attribute key.
16301630

appwrite/services/tables_db.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ def update_ip_column(self, database_id: str, table_id: str, key: str, required:
12751275
'content-type': 'application/json',
12761276
}, api_params)
12771277

1278-
def create_line_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None) -> Dict[str, Any]:
1278+
def create_line_column(self, database_id: str, table_id: str, key: str, required: bool, default: List[Any] = None) -> Dict[str, Any]:
12791279
"""
12801280
Create a geometric line column.
12811281
@@ -1289,8 +1289,8 @@ def create_line_column(self, database_id: str, table_id: str, key: str, required
12891289
Column Key.
12901290
required : bool
12911291
Is column required?
1292-
default : str
1293-
Default value for column when not provided, as JSON string. Cannot be set when column is required.
1292+
default : List[Any]
1293+
Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.
12941294
12951295
Returns
12961296
-------
@@ -1328,7 +1328,7 @@ def create_line_column(self, database_id: str, table_id: str, key: str, required
13281328
'content-type': 'application/json',
13291329
}, api_params)
13301330

1331-
def update_line_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None, new_key: str = None) -> Dict[str, Any]:
1331+
def update_line_column(self, database_id: str, table_id: str, key: str, required: bool, default: List[Any] = None, new_key: str = None) -> Dict[str, Any]:
13321332
"""
13331333
Update a line column. Changing the `default` value will not update already existing rows.
13341334
@@ -1342,8 +1342,8 @@ def update_line_column(self, database_id: str, table_id: str, key: str, required
13421342
Column Key.
13431343
required : bool
13441344
Is column required?
1345-
default : str
1346-
Default value for column when not provided, as JSON string. Cannot be set when column is required.
1345+
default : List[Any]
1346+
Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.
13471347
new_key : str
13481348
New Column Key.
13491349
@@ -1384,7 +1384,7 @@ def update_line_column(self, database_id: str, table_id: str, key: str, required
13841384
'content-type': 'application/json',
13851385
}, api_params)
13861386

1387-
def create_point_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None) -> Dict[str, Any]:
1387+
def create_point_column(self, database_id: str, table_id: str, key: str, required: bool, default: List[Any] = None) -> Dict[str, Any]:
13881388
"""
13891389
Create a geometric point column.
13901390
@@ -1398,8 +1398,8 @@ def create_point_column(self, database_id: str, table_id: str, key: str, require
13981398
Column Key.
13991399
required : bool
14001400
Is column required?
1401-
default : str
1402-
Default value for column when not provided, as JSON string. Cannot be set when column is required.
1401+
default : List[Any]
1402+
Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.
14031403
14041404
Returns
14051405
-------
@@ -1437,7 +1437,7 @@ def create_point_column(self, database_id: str, table_id: str, key: str, require
14371437
'content-type': 'application/json',
14381438
}, api_params)
14391439

1440-
def update_point_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None, new_key: str = None) -> Dict[str, Any]:
1440+
def update_point_column(self, database_id: str, table_id: str, key: str, required: bool, default: List[Any] = None, new_key: str = None) -> Dict[str, Any]:
14411441
"""
14421442
Update a point column. Changing the `default` value will not update already existing rows.
14431443
@@ -1451,8 +1451,8 @@ def update_point_column(self, database_id: str, table_id: str, key: str, require
14511451
Column Key.
14521452
required : bool
14531453
Is column required?
1454-
default : str
1455-
Default value for column when not provided, as JSON string. Cannot be set when column is required.
1454+
default : List[Any]
1455+
Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.
14561456
new_key : str
14571457
New Column Key.
14581458
@@ -1493,7 +1493,7 @@ def update_point_column(self, database_id: str, table_id: str, key: str, require
14931493
'content-type': 'application/json',
14941494
}, api_params)
14951495

1496-
def create_polygon_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None) -> Dict[str, Any]:
1496+
def create_polygon_column(self, database_id: str, table_id: str, key: str, required: bool, default: List[Any] = None) -> Dict[str, Any]:
14971497
"""
14981498
Create a geometric polygon column.
14991499
@@ -1507,8 +1507,8 @@ def create_polygon_column(self, database_id: str, table_id: str, key: str, requi
15071507
Column Key.
15081508
required : bool
15091509
Is column required?
1510-
default : str
1511-
Default value for column when not provided, as JSON string. Cannot be set when column is required.
1510+
default : List[Any]
1511+
Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.
15121512
15131513
Returns
15141514
-------
@@ -1546,7 +1546,7 @@ def create_polygon_column(self, database_id: str, table_id: str, key: str, requi
15461546
'content-type': 'application/json',
15471547
}, api_params)
15481548

1549-
def update_polygon_column(self, database_id: str, table_id: str, key: str, required: bool, default: str = None, new_key: str = None) -> Dict[str, Any]:
1549+
def update_polygon_column(self, database_id: str, table_id: str, key: str, required: bool, default: List[Any] = None, new_key: str = None) -> Dict[str, Any]:
15501550
"""
15511551
Update a polygon column. Changing the `default` value will not update already existing rows.
15521552
@@ -1560,8 +1560,8 @@ def update_polygon_column(self, database_id: str, table_id: str, key: str, requi
15601560
Column Key.
15611561
required : bool
15621562
Is column required?
1563-
default : str
1564-
Default value for column when not provided, as JSON string. Cannot be set when column is required.
1563+
default : List[Any]
1564+
Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.
15651565
new_key : str
15661566
New Column Key.
15671567

docs/examples/account/update-prefs.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@ client.set_session('') # The user session to authenticate with
99
account = Account(client)
1010

1111
result = account.update_prefs(
12-
prefs = {}
12+
prefs = {
13+
"language": "en",
14+
"timezone": "UTC",
15+
"darkTheme": True
16+
}
1317
)

docs/examples/databases/create-document.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ result = databases.create_document(
1212
database_id = '<DATABASE_ID>',
1313
collection_id = '<COLLECTION_ID>',
1414
document_id = '<DOCUMENT_ID>',
15-
data = {},
15+
data = {
16+
"username": "walter.obrien",
17+
"email": "walter.obrien@example.com",
18+
"fullName": "Walter O'Brien",
19+
"age": 30,
20+
"isAdmin": False
21+
},
1622
permissions = ["read("any")"] # optional
1723
)

docs/examples/databases/create-line-attribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ result = databases.create_line_attribute(
1313
collection_id = '<COLLECTION_ID>',
1414
key = '',
1515
required = False,
16-
default = '' # optional
16+
default = [[1,2], [3, 4]] # optional
1717
)

docs/examples/databases/create-point-attribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ result = databases.create_point_attribute(
1313
collection_id = '<COLLECTION_ID>',
1414
key = '',
1515
required = False,
16-
default = '' # optional
16+
default = [[1,2], [3, 4]] # optional
1717
)

docs/examples/databases/create-polygon-attribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ result = databases.create_polygon_attribute(
1313
collection_id = '<COLLECTION_ID>',
1414
key = '',
1515
required = False,
16-
default = '' # optional
16+
default = [[1,2], [3, 4]] # optional
1717
)

docs/examples/databases/update-line-attribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ result = databases.update_line_attribute(
1313
collection_id = '<COLLECTION_ID>',
1414
key = '',
1515
required = False,
16-
default = '', # optional
16+
default = [[1,2], [3, 4]], # optional
1717
new_key = '' # optional
1818
)

docs/examples/databases/update-point-attribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ result = databases.update_point_attribute(
1313
collection_id = '<COLLECTION_ID>',
1414
key = '',
1515
required = False,
16-
default = '', # optional
16+
default = [[1,2], [3, 4]], # optional
1717
new_key = '' # optional
1818
)

docs/examples/databases/update-polygon-attribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ result = databases.update_polygon_attribute(
1313
collection_id = '<COLLECTION_ID>',
1414
key = '',
1515
required = False,
16-
default = '', # optional
16+
default = [[1,2], [3, 4]], # optional
1717
new_key = '' # optional
1818
)

0 commit comments

Comments
 (0)