In Django model QuerySets, I see that there is a __gt and __lt for comparative values, but is there a __ne or != (not equals)? I want to filter out using a not equals. For example, for
Model:
bool a;
int …
I've got a field in one model like:
class Sample(models.Model):
date = fields.DateField(auto_now=False)
Now, I need to filter the objects by a date range.
How do I filter all the objects that have a date …
I'm sure this is a trivial operation, but I can't figure out how it's done.
There's got to be something smarter than this:
ids = [1, 3, 6, 7, 9]
for id in ids:
MyModel.objects.filter(pk=id)
I'm looking to get them all in …