Pickle a BaseModel in a flat way