flask-peewee icon indicating copy to clipboard operation
flask-peewee copied to clipboard

get_model_from_dictionary and JSONField

Open rammie opened this issue 10 years ago • 0 comments

Fields that may be provided as dictionaries break this function. Specifically it breaks when using JSON or HStore fields from the peewee postgres_ext. The function assumes that if the value is a dictionary then the field must be a ForeignKeyField. One way to fix this would be to change the condition to:

if isinstance(value, dict) and isinstance(field, ForeignKeyField):
    ...

rammie avatar Mar 15 '14 20:03 rammie