Can you use a dict instead of elifs?
<pre>
operators = {
    '==': '',
    '>': '__gt',
    '>=': '__gte',
    ...
}
soft_q = Q(**{'software_version' + operators[operator]: version})