Skip to content

Commit c36d726

Browse files
committed
Add 1.8.x support
1 parent 82d29c9 commit c36d726

File tree

6 files changed

+6
-25
lines changed

6 files changed

+6
-25
lines changed

appwrite/encoders/value_class_encoder.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from ..enums.browser import Browser
66
from ..enums.credit_card import CreditCard
77
from ..enums.flag import Flag
8-
from ..enums.type import Type
98
from ..enums.relationship_type import RelationshipType
109
from ..enums.relation_mutate import RelationMutate
1110
from ..enums.index_type import IndexType
@@ -45,9 +44,6 @@ def default(self, o):
4544
if isinstance(o, Flag):
4645
return o.value
4746

48-
if isinstance(o, Type):
49-
return o.value
50-
5147
if isinstance(o, RelationshipType):
5248
return o.value
5349

appwrite/enums/type.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

appwrite/services/databases.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from ..service import Service
22
from typing import List, Dict, Any
33
from ..exception import AppwriteException
4-
from ..enums.type import Type;
54
from ..enums.relationship_type import RelationshipType;
65
from ..enums.relation_mutate import RelationMutate;
76
from ..enums.index_type import IndexType;
@@ -44,7 +43,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]:
4443
return self.client.call('get', api_path, {
4544
}, api_params)
4645

47-
def create(self, database_id: str, name: str, enabled: bool = None, type: Type = None) -> Dict[str, Any]:
46+
def create(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Any]:
4847
"""
4948
Create a new Database.
5049
@@ -59,8 +58,6 @@ def create(self, database_id: str, name: str, enabled: bool = None, type: Type =
5958
Database name. Max length: 128 chars.
6059
enabled : bool
6160
Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
62-
type : Type
63-
Database type.
6461
6562
Returns
6663
-------
@@ -85,7 +82,6 @@ def create(self, database_id: str, name: str, enabled: bool = None, type: Type =
8582
api_params['databaseId'] = database_id
8683
api_params['name'] = name
8784
api_params['enabled'] = enabled
88-
api_params['type'] = type
8985

9086
return self.client.call('post', api_path, {
9187
'content-type': 'application/json',

appwrite/services/tables_db.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from ..service import Service
22
from typing import List, Dict, Any
33
from ..exception import AppwriteException
4-
from ..enums.type import Type;
54
from ..enums.relationship_type import RelationshipType;
65
from ..enums.relation_mutate import RelationMutate;
76
from ..enums.index_type import IndexType;
@@ -42,7 +41,7 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]:
4241
return self.client.call('get', api_path, {
4342
}, api_params)
4443

45-
def create(self, database_id: str, name: str, enabled: bool = None, type: Type = None) -> Dict[str, Any]:
44+
def create(self, database_id: str, name: str, enabled: bool = None) -> Dict[str, Any]:
4645
"""
4746
Create a new Database.
4847
@@ -55,8 +54,6 @@ def create(self, database_id: str, name: str, enabled: bool = None, type: Type =
5554
Database name. Max length: 128 chars.
5655
enabled : bool
5756
Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
58-
type : Type
59-
Database type.
6057
6158
Returns
6259
-------
@@ -81,7 +78,6 @@ def create(self, database_id: str, name: str, enabled: bool = None, type: Type =
8178
api_params['databaseId'] = database_id
8279
api_params['name'] = name
8380
api_params['enabled'] = enabled
84-
api_params['type'] = type
8581

8682
return self.client.call('post', api_path, {
8783
'content-type': 'application/json',
@@ -1722,7 +1718,7 @@ def update_relationship_column(self, database_id: str, table_id: str, key: str,
17221718

17231719
def list_indexes(self, database_id: str, table_id: str, queries: List[str] = None) -> Dict[str, Any]:
17241720
"""
1725-
List indexes in the collection.
1721+
List indexes on the table.
17261722
17271723
Parameters
17281724
----------
@@ -1763,7 +1759,7 @@ def list_indexes(self, database_id: str, table_id: str, queries: List[str] = Non
17631759
def create_index(self, database_id: str, table_id: str, key: str, type: IndexType, columns: List[str], orders: List[str] = None, lengths: List[float] = None) -> Dict[str, Any]:
17641760
"""
17651761
Creates an index on the columns listed. Your index should include all the columns you will query in a single request.
1766-
Attributes can be `key`, `fulltext`, and `unique`.
1762+
Type can be `key`, `fulltext`, or `unique`.
17671763
17681764
Parameters
17691765
----------

docs/examples/databases/create.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ databases = Databases(client)
1111
result = databases.create(
1212
database_id = '<DATABASE_ID>',
1313
name = '<NAME>',
14-
enabled = False, # optional
15-
type = .TABLESDB # optional
14+
enabled = False # optional
1615
)

docs/examples/tablesdb/create.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ tables_db = TablesDb(client)
1111
result = tables_db.create(
1212
database_id = '<DATABASE_ID>',
1313
name = '<NAME>',
14-
enabled = False, # optional
15-
type = .TABLESDB # optional
14+
enabled = False # optional
1615
)

0 commit comments

Comments
 (0)