Browse Source

updated comments.

Charlie Root 7 years ago
parent
commit
2e4a5ec767
1 changed files with 3 additions and 0 deletions
  1. 3 0
      ibr1.py

+ 3 - 0
ibr1.py

@@ -97,6 +97,9 @@ class Zipcode(db.Model):
 api = Api(app)
 
 def model_to_dict(model):
+    """ Given a SQLAlchemy model, return a dictionary.
+    This allows for the model to be easily jsonified.
+    """
     data = {}
     for col in model.__table__.c.keys():
         # data[col] = getattr(c, col, None) # c[col]