def serialize_stats(model):
 data = model_to_dict(model)
 del data['id']
 return json.dumps(data)

def serialize_stats ( model ) : data = model_to_dict ( model ) del data [ 'id' ] return json . dumps ( data )
return the stats from the model ready to write to a file .