Select with complex where statement don't transform correctly
Peewee will generate that `0 = 1` when you write an expression that evalutes to `WHERE x IN ()` (which is always false):

```python
.where(Model.field.in_([]))
```

So in your example, at least one of your lists is empty, or alternatively your `tickets` iterator is a generator or something and returns a list, but when iterated the 2nd time it is consumed and returns an empty list.
I was building a complex query in my app which is describe below:

`query = (self.repository.getSelect((
            fieldId,
            fieldReceivedAt,
            fieldMac,
            fieldCode,
            fieldDomain,
            fieldStatus
        ))
            .where(
                fieldId.between(initialId, endId + 10000) &
                SystemEventModel.Message.contains('done query') &
                self.__getCodeFuncField().in_([t.code for t in tickets]) &
                SystemEventModel.FromHost.in_([t.mac for t in tickets])
            )
            .order_by(fieldCode))`

The sintax seems correct by when I run the application, the ORM makes my query look like below:

`SELECT t1.ID AS id, t1.ReceivedAt AS received_at, t1.FromHost AS mac, TRIM(SUBSTR(SUBSTR(t1.Message, INSTR(t1.Message, '#'), 11), 1, INSTR(SUBSTR(t1.Message, INSTR(t1.Message, '#'), 11), ' '))) AS code, TRIM(IF((INSTR(t1.Message, 'dns name exists') > 0), 'dns name exists, but no appropriate record', SUBSTR(TRIM(SUBSTR(SUBSTR(t1.Message, INSTR(t1.Message, '#'), 100), INSTR(SUBSTR(t1.Message, INSTR(t1.Message, '#'), 100), ' '), 100)), 1, INSTR(TRIM(SUBSTR(SUBSTR(t1.Message, INSTR(t1.Message, '#'), 100), INSTR(SUBSTR(t1.Message, INSTR(t1.Message, '#'), 100), ' '), 100)), ' ')))) AS domain, TRIM(IF((INSTR(t1.Message, 'dns name exists') > 0), 1, IF((INSTR(t1.Message, 'dns does not exist') > 0), 0, 2))) AS status FROM SystemEvents AS t1 WHERE ((((id BETWEEN 23706618 AND 23726554) AND (t1.Message LIKE '%done query%')) AND (TRIM(SUBSTR(SUBSTR(t1.Message, INSTR(t1.Message, '#'), 11), 1, INSTR(SUBSTR(t1.Message, INSTR(t1.Message, '#'), 11), ' '))) IN ('#118729', '#118730', '#12485651', '#12485652', '#12485653', '#129837753', '#129837754', '#1301639'))) AND (0 = 1)) ORDER BY code`

Why the last where was transformed into `(0 = 1)` if it is a **where in** statement?

Any help would be appreciated.

Thanks