[Django]-Django.core.exceptions.FieldError: Cannot resolve keyword 'timestamp' into field

6👍

From the error it should be something like that:

similar_actions = Action.objects.filter(created__gte=last_minute, user_id=user.id, verb=verb)

You’re querying for the timestamp attribute of the Action model which does not exist. The available choices are:

created, id, target, target_ct, target_ct_id, target_id, user, user_id, verb

So, you should query the database based on those (or any relation of those) that are attributes of your Action model.

👤nik_m

3👍

I had the same error when one of columns in my second database was removed.

You can try to reset migrations:

  1. Remove the all migrations files within your project.
    Go through each of your projects apps migration folder (your_app/migrations/) and remove everything inside, except the init.py file.
  2. Run makemigrations and migrate.

Not sure about your case, but this solved the same error in my situation.

👤Nairum

Leave a comment