2👍
✅
0👍
Not only the ‘&’ but also Comma ‘,’ represents AND in django Q objects so you can also try:
from django.db.models import Q
_entry = Entry.objects.get(Q(slug=slug), Q(author=self.author) , ~Q(id=self.id))
Although I couldn’t recreate the error that you get. Also please make sure slug,self.author and self.id have proper type of data to go into respective fields.
Here are the docs for complete reference
- [Answered ]-Ipdb is triggering ImportError
- [Answered ]-Django get base model from parent model
- [Answered ]-Reverse Relationships in Django-Rest framework
- [Answered ]-Django+gunicorn+nginx 404 serving static files
- [Answered ]-JQuery not working after ajax call, even though I'm using the correct on() method
Source:stackexchange.com