Query bug
First of all, your use of the python `and` keyword is incorrect -- see [query operators table](http://docs.peewee-orm.com/en/latest/peewee/querying.html#query-operators), particularly the section on logical operators.

As to the other examples, I will take a look. Your final query (using `&`) looks like it should work but I'm surprised the chained calls to .where do not since those should be equivalent.
 > > peewee.OperationalError: user-defined function raised exception

Is it possible that in the first query you have a `None` value in the `deadline` column? I wonder if SQLite is running that filter first in the query that's failing, and it succeeds in the other examples because the result-set has already been filtered.
 > Is it possible that in the first query you have a None value in the deadline column? 

Bingo!
My apologies. :)
 Fixed in ffbfb9c024d5a63e895888b7f6eee46ad7f39b4b

``` python
    tasks = Task.select()\
      .where(Task.deadline.year == year)\
      .where(Task.performer << performers)\
      .where(Task.state << (States.ACCEPTED, States.CLOSED))
```

peewee.OperationalError: user-defined function raised exception

``` python
    tasks = Task.select()\
      .where(Task.performer << performers)\
      .where(Task.state << (States.ACCEPTED, States.CLOSED))\
      .where(Task.deadline.year == year)
```

works fine

Also

``` python
    tasks = Task.select().where(
      (Task.performer << performers) and
      (Task.state << (States.ACCEPTED, States.CLOSED)) and
      (Task.deadline == year)
    )
    print(tasks)
```

result

```
<class 'tm.tasks.models.Task'> SELECT "t1"."id", "t1"."title", "t1"."task_type", "t1"."desc", "t1"."deadline", "t1"."customer_id", "t1"."performer_id", "t1"."related_proj_id", "t1"."related_task_id", "t1"."state" FROM "tasks" AS t1 WHERE ("t1"."deadline" = ?) ORDER BY "t1"."id" DESC [2014]
```

and

``` python
    tasks = Task.select().where(
      (Task.performer << performers) &
      (Task.state << (States.ACCEPTED, States.CLOSED)) &
      (Task.deadline == year)
    )
    print(tasks)
```

result

```
<class 'tm.tasks.models.Task'> SELECT "t1"."id", "t1"."title", "t1"."task_type", "t1"."desc", "t1"."deadline", "t1"."customer_id", "t1"."performer_id", "t1"."related_proj_id", "t1"."related_task_id", "t1"."state" FROM "tasks" AS t1 WHERE ((("t1"."performer_id" IN (SELECT "t2"."id" FROM "users" AS t2 WHERE ("t2"."group_id" = ?))) AND ("t1"."state" IN (?, ?))) AND ("t1"."deadline" = ?)) ORDER BY "t1"."id" DESC [1, 'accepted', 'closed', 2014]
```

Python 3.4
Flask 0.10.1
peewee 2.3.2
psycopg2 2.5.4
