I'm newbie with python and django and now I'm learning how to simplify code in writing the if ..else
statements in one line.
But in this case I have a two querysets with a little change . I want to know if it is possible to simlify this code in one line
if self.booked:
x = qs.filter(content_id=content_id, object_id=model.id, action=10)
else:
x = qs.filter(content_id=content_id, object_id=model.id).exclude(action=10)
return x