Primary keys that aren't integers
Well, it really just looks like it's searching for a pk that evaluates to a nonzero...it will be tricky since the postgresql adapter checks the value of a sequence for the last insert id.  Otherwise its just that bit in the BaseModel that checks for a PrimaryKeyField.

On the other hand, a non-integer primary key can be more expensive to query on and join on... might be worthwhile to implement instead the ability to add unique indexes and have something along the lines of the workaround suggested here:
http://stackoverflow.com/questions/3936182/using-a-uuid-as-a-primary-key-in-django-models-generic-relations-impact/3944247#3944247
 Interesting point, and one I didn't know about.  I'll take a look into it -- thank you!
 I've added ability to specify a unique keyword arg when creating fields:
https://github.com/coleifer/peewee/commit/c3460e32ae375984c97f28c6ec8f7b65a8ead8cf
 This is awesome -- thank you very much!
 Glad that commit helps -- I'm actually gonna leave this one open for now as I agree it _should_ be possible to use a TextField or something else for a primary key.
 +1 , in some case it would be important, agree it should be possible to use a CharField
 +1 to a primarykey CharField
 Also relevant: biginteger fields
 Started working on this in a branch: feature/non-integer-pk -- there are some interesting ramifications:
- primary keys may not be autoincrementing which affects default save() and create() behavior
- primary keys won't necessarily have a sequence so postgresql will need to have different last_insert_id behavior if so
- foreign keys need to match the column type of the primary key
 Alright!  I think I have gotten this working.  It can be seen in the field refactor branch:

https://github.com/coleifer/peewee/tree/feature/field-refactor

For a diff:

https://github.com/coleifer/peewee/compare/feature/field-refactor

Tests are passing in sqlite and postgresql.  Saving models is a little bit different when using a non-integer autoincrement pk, basically you have to use the .create() or .save(force_insert=True) to save new instances otherwise the existance of a pk value will make the orm think you have saved it before and want to update it.  That is the main gotcha.

Would love to get some feedback before merging, however
 Merged, syntax is

``` python

class NonIntPK(TestModel):
    id = PrimaryKeyField(column_class=VarCharColumn)
    name = CharField(max_length=10)
```

We're currently using the (hex/char) representation of UUIDs for a database, to use as primary keys.  It looks like the current implementation requires Primary Key (and thus the .save() method) be an integer, and this is further checked through the isinstance call during creation of a model.  It would be really great if we could use a TextField, or any field, as primary key.
