Skip to content

Commit aaa7691

Browse files
authored
Merge pull request #116 from appwrite/dev
Add time between queries
2 parents 3cbd608 + 5db0860 commit aaa7691

26 files changed

+965
-15
lines changed

appwrite/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ def __init__(self):
1414
self._endpoint = 'https://cloud.appwrite.io/v1'
1515
self._global_headers = {
1616
'content-type': '',
17-
'user-agent' : f'AppwritePythonSDK/12.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})',
17+
'user-agent' : f'AppwritePythonSDK/13.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})',
1818
'x-sdk-name': 'Python',
1919
'x-sdk-platform': 'server',
2020
'x-sdk-language': 'python',
21-
'x-sdk-version': '12.0.0',
21+
'x-sdk-version': '13.0.0',
2222
'X-Appwrite-Response-Format' : '1.8.0',
2323
}
2424

appwrite/enums/credit_card.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class CreditCard(Enum):
1313
MASTERCARD = "mastercard"
1414
NARANJA = "naranja"
1515
TARJETA_SHOPPING = "targeta-shopping"
16-
UNION_CHINA_PAY = "union-china-pay"
16+
UNION_PAY = "unionpay"
1717
VISA = "visa"
1818
MIR = "mir"
1919
MAESTRO = "maestro"

appwrite/enums/execution_method.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ class ExecutionMethod(Enum):
77
PATCH = "PATCH"
88
DELETE = "DELETE"
99
OPTIONS = "OPTIONS"
10+
HEAD = "HEAD"

appwrite/enums/index_type.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ class IndexType(Enum):
44
KEY = "key"
55
FULLTEXT = "fulltext"
66
UNIQUE = "unique"
7+
SPATIAL = "spatial"

appwrite/query.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ def created_before(value):
127127
def created_after(value):
128128
return str(Query("createdAfter", None, value))
129129

130+
@staticmethod
131+
def created_between(start, end):
132+
return str(Query("createdBetween", None, [start, end]))
133+
130134
@staticmethod
131135
def updated_before(value):
132136
return str(Query("updatedBefore", None, value))
@@ -135,10 +139,62 @@ def updated_before(value):
135139
def updated_after(value):
136140
return str(Query("updatedAfter", None, value))
137141

142+
@staticmethod
143+
def updated_between(start, end):
144+
return str(Query("updatedBetween", None, [start, end]))
145+
138146
@staticmethod
139147
def or_queries(queries):
140148
return str(Query("or", None, [json.loads(query) for query in queries]))
141149

142150
@staticmethod
143151
def and_queries(queries):
144152
return str(Query("and", None, [json.loads(query) for query in queries]))
153+
154+
@staticmethod
155+
def distance_equal(attribute, values, distance, meters=True):
156+
return str(Query("distanceEqual", attribute, [[values, distance, meters]]))
157+
158+
@staticmethod
159+
def distance_not_equal(attribute, values, distance, meters=True):
160+
return str(Query("distanceNotEqual", attribute, [[values, distance, meters]]))
161+
162+
@staticmethod
163+
def distance_greater_than(attribute, values, distance, meters=True):
164+
return str(Query("distanceGreaterThan", attribute, [[values, distance, meters]]))
165+
166+
@staticmethod
167+
def distance_less_than(attribute, values, distance, meters=True):
168+
return str(Query("distanceLessThan", attribute, [[values, distance, meters]]))
169+
170+
@staticmethod
171+
def intersects(attribute, values):
172+
return str(Query("intersects", attribute, [values]))
173+
174+
@staticmethod
175+
def not_intersects(attribute, values):
176+
return str(Query("notIntersects", attribute, [values]))
177+
178+
@staticmethod
179+
def crosses(attribute, values):
180+
return str(Query("crosses", attribute, [values]))
181+
182+
@staticmethod
183+
def not_crosses(attribute, values):
184+
return str(Query("notCrosses", attribute, [values]))
185+
186+
@staticmethod
187+
def overlaps(attribute, values):
188+
return str(Query("overlaps", attribute, [values]))
189+
190+
@staticmethod
191+
def not_overlaps(attribute, values):
192+
return str(Query("notOverlaps", attribute, [values]))
193+
194+
@staticmethod
195+
def touches(attribute, values):
196+
return str(Query("touches", attribute, [values]))
197+
198+
@staticmethod
199+
def not_touches(attribute, values):
200+
return str(Query("notTouches", attribute, [values]))

appwrite/services/account.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -869,8 +869,8 @@ def update_magic_url_session(self, user_id: str, secret: str) -> Dict[str, Any]:
869869
"""
870870
Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
871871
872-
.. deprecated::
873-
This API has been deprecated.
872+
.. deprecated::1.6.0
873+
This API has been deprecated since 1.6.0. Please use `account.create_session` instead.
874874
Parameters
875875
----------
876876
user_id : str
@@ -909,8 +909,8 @@ def update_phone_session(self, user_id: str, secret: str) -> Dict[str, Any]:
909909
"""
910910
Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
911911
912-
.. deprecated::
913-
This API has been deprecated.
912+
.. deprecated::1.6.0
913+
This API has been deprecated since 1.6.0. Please use `account.create_session` instead.
914914
Parameters
915915
----------
916916
user_id : str

appwrite/services/avatars.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float =
6262
Parameters
6363
----------
6464
code : CreditCard
65-
Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.
65+
Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
6666
width : float
6767
Image width. Pass an integer between 0 to 2000. Defaults to 100.
6868
height : float

0 commit comments

Comments
 (0)