Recursive save
It's pretty simple - check out: https://github.com/coleifer/flask-peewee/blob/master/flask_peewee/rest.py#L419 for an example of how flask-peewee's REST module handles it.

You could also write something recursive. To get the relations, just look at the `model._meta.refs` dict, which maps field instances to related models.

Untested:

```python

accum = [obj]
while accum:
    curr = accum.pop()
    curr.save()
    for fk in curr._meta.refs:
        rel_obj = getattr(curr, fk.name, None)
        if rel_obj is not None:
            accum.append(rel_obj)
``` It looks like this does successfully save all the objects, but it doesn't seem to properly save the foreign key relations in the database. Do you know why that is? You probably aren't setting things properly, I have no idea - check your code.
Is there a convenient function to recursively save a nested object? I'm using [`dict_to_model`](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#dict_to_model) that produces a nested object, and calling `save` on the returned object seems to only save the top-level one.