coleifer/flask-peewee — pull request #80 by jhorman (2013-06-27 15:24:30+00:00)
Title: Inserts a "None" option at the top of the ajax list if the field is nullable

If I have a model field that is nullable,

group = peewee.ForeignKeyField(Group, null=True, db_index=True, rules=Rules(api=ApiRule(edit=False)))

Along with this in my model admin

foreign_key_lookups = {'group': 'name'}

I get the nice ajax popup, but I can't null out the field if I have previously set a value.

This change adds a None option to the top of the ajax popup.