For your own sanity I'd use constants somewhere instead of numeric values for `state`. So somewhere in your model have a `STATE = 1` and then in your query do a `filter(state__lte=STATE)`