Race condition in example
That's too bad you found a "code smell".

The example app is meant to be very simple and approachable, especially for someone new to peewee. The fact that it doesn't handle concurrent requests to create a new account was acceptable to me when I wrote it, but I guess that is a code smell.

Since you point it out, I have changed the code smell and also updated due to some changes in flask's session serialization: 5fa6d43f0a806f6b965f8ae3bacaf3e42b2335de .
 Thanks! I've been bitten in the past by this exact bug with other libraries because I hadn't seen examples done "correctly". Now I know how to account for this.

I was trying out peewee and reading through the documentation when I came across a code smell.

The [documentation](http://peewee.readthedocs.org/en/latest/peewee/example.html?#creating-new-objects) gives an example as follows:

``` Python
try:
    user = User.get(User.username == request.form['username'])
    ...
except User.DoesNotExist:
    user = User.create( ... )
    ...
```

This isn't how I [normally](http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#eafp-vs-lbyl) see this sort of functionality implemented, due to a race condition where e.g. two clients are both interacting and both successfully determine that a user does not exist before either creates the user, then both create the user.

Generally, I would see something like the following instead, which may be possible in peewee already... I haven't used it enough yet to know how exceptions and uniqueness work. If that's the case, this is just a documentation fix.

``` Python
try:
    user = User.create( ... )
    ...
except User.AlreadyExists:
    user = User.get(User.username == request.form['username'])
    ...
```
