Skip to content

Instantly share code, notes, and snippets.

@kishorenc
Created November 16, 2017 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kishorenc/f18dbe66c3adb86d7a2d8546df5fba20 to your computer and use it in GitHub Desktop.
Save kishorenc/f18dbe66c3adb86d7a2d8546df5fba20 to your computer and use it in GitHub Desktop.
class Student:
def __init__(self, id, first_name, last_name):
self.id = id
self.first_name = first_name
self.last_name = last_name
class Students:
def get_all(self):
r = request.get('/students')
students_json = r.loads(r.text)
students = []
for student_obj in students_json:
students.append(Student(student_obj['id'], student_obj['first_name'], student_obj['last_name']))
return student
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment