Gql request for date

How to apply a GQL query to indicate the username in the table of the UserInformation model of those who have logged in in the last 3 days?

0
source share
1 answer

I assume UserInformation is your own class, it is not part of any App Engine model that I know, and you are using python.

You cannot return only the list user_names, you will receive a collection of instances of the UserInformation model.

Do you have the latest property to enter your model? If so, then the following should work.

three_days_ago = datetime.datetime.now() - datetime.timedelta(days = 3)
users = db.Query(UserInformation).filter("login_date >", three_days_ago).fetch(10)
+4
source

Source: https://habr.com/ru/post/1755725/


All Articles