
The REST API for Between in python seems to not be working, I tried first storing my date as a DateTime, but that didn't work, so I switched it to a string and tried using ISOFormat but that errors out too, here's the code and error
def get_articles(self, days_tolerance: int = int(days_to_report)):
"""
Gets articles from the Appwrite Database for today that we haven't vectorized yet
"""
now = self.utils.get_now()
min_published_date = now - timedelta(days=days_tolerance)
print(f"Getting articles from {min_published_date} to {now}")
start = min_published_date.isoformat()
end = now.isoformat()
between = now - timedelta(days=days_tolerance / 2)
print(
f"Testing DateTime Between with ISO Strings: {between.isoformat()} is between {min_published_date.isoformat()} and {now.isoformat()}: {between.isoformat() > min_published_date.isoformat() and between.isoformat() < now.isoformat()}"
)
articles = self.db.list_documents(
APPWRITE_DB,
"articles",
[
Query.between(
"date",
json.dumps(start),
json.dumps(end),
),
Query.equal("used", False),
],
).get("documents")
print(f"Got articles: {articles}")
if len(articles) < 5:
search_response = self.utils.search("Crypto news today")
print(f"New articles found: {search_response}")
return self.db.list_documents(
APPWRITE_DB, "articles", [Query.between()]
)
and the error attached

this is a known issue. see https://github.com/appwrite/appwrite/issues/5650

oh

cool

?solved

Y'know, you can update the post title too

[SOLVED] Query.between in Python DateTime broken
Recommended threads
- Cannot build angular 20 sites
The openruntime node 22 version is 22.9 and angular 20 requires 22.14 or above. Could you please release a new openruntime node 22 version for angular 20 ?
- Cannot create function from CLI with KEY
I tried to setup a gitlab CI that push functions from an appwrite.json, tho when doing a first push it fails saying it needs a session. Tho it does create the f...
- appwrite/appwrite:1.7.4 image missing En...
Hi Team, I'm experiencing a critical issue when deploying the official appwrite/appwrite:1.7.4 Docker image. After pulling the image (both by tag and by digest...
