You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While Tagulous tries to make the TagField a first-class citizen in Django, it does so by overriding things in managers, querysets etc - and I hadn't tried it with Q objects! At some point I'll need to look at if I can override that, but I'm really struggling for time at the moment, so it's going to be a while before I can take a look.
In the meantime, it's failing because tags is actually a M2M field, so the filter call will be expecting the Q object to look by primary key, in this case an int.
I am trying to filter using tags created with taguluous. However, when using the Q object to filter the tags, it comes up with this error
Exception Value: invalid literal for int() with base 10: '(my tag)'
where the line of code the error appears is in :
recipe_list= RecipePage.objects.filter(Q(recipeName__icontains = word) | **Q(tags = word)**)
In my models.py:
Let me know if there's another or better way to use multiple arguments to filter my queryset!
Thank you!
The text was updated successfully, but these errors were encountered: