Filtering on action_object: Field 'action_object' does not generate an automatic reverse relation and therefore cannot be used for reverse querying.
See original GitHub issueHi! I used your example from https://github.com/django-notifications/django-notifications/issues/64#issuecomment-111934724 to add a Notification model that is saved as the action_object
.
However, when in the stream I try to return sender.actor_actions.filter('action_object__read': False)
(sender
ist the current user), Django fails with Field 'action_object' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. If it is a GenericForeignKey, consider adding a GenericRelation.
I don’t really understand this error, because I am not actually querying in reverse here, am I?
Any ideas?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to traverse a GenericForeignKey in Django?
filter(bar__name='bar x') FieldError: Field 'bar' does not generate an automatic reverse relation and therefore cannot be used for reverse ...
Read more >Field 'actor' does not generate an automatic reverse relation ...
Filter Action Error: Field 'actor' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. #318.
Read more >IBM Cognos Analytics - Reporting Version 11.1 : User Guide
IBM Cognos Analytics - Reporting automatically creates the queries you need as you build reports. However, you can modify these queries or create...
Read more >Rules and Policies 7 Administration for SonicOS - SonicWall
This is an overview of the SonicWall network security appliance default access rules and custom access rules. Access rules are network management tools...
Read more >Visual Policy Manager Reference | TechDocs - Broadcom Inc.
does not assume any liability arising out of the application or use of this information, ... Creating the Reverse DNS Lookup Restriction List...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Similar issue here. Any idea?
I succeeded a bit with adding the GenericRelation and querying based on the
related_name
I gave that. However, then it failed because my model’spk
was an Integer, whileaction_object_id
is aCharField
(which PostgreSQL doesnt like).I’ll create a test project to showcase this problem.