
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
- 1.7.0 Self Hosted Upgrade
Hi, I've tried a fresh install on 1.7.0 and I've also done a fresh install on 1.6.2. 1.6.2 is working fine fresh, update to 1.7.0 and migrate fails Fresh inst...
- Functions not work on Server only Localh...
Hi, I successfully upgraded from 1.4 to 1.7, but I'm having a problem. The functions no longer work with the settings I had. I assume some changes were made. It...
- Console Login after upgrade
Hi, running a small instance self hosted, upgraded from 1.6.0 to 1.74 this morning before spotting the migration guide... When trying to login to the console n...
