Skip to content

Instantly share code, notes, and snippets.

@bekatom
Created July 21, 2015 15:57
Show Gist options
  • Select an option

  • Save bekatom/8c24accca3d48053d385 to your computer and use it in GitHub Desktop.

Select an option

Save bekatom/8c24accca3d48053d385 to your computer and use it in GitHub Desktop.
list_to_dict.py
#SQL alchemy object to list method
def to_dict(data):
"""
:param data:
:returns objects list in dictionary :
"""
return [u.__dict__ for u in data]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment