From 70e6641e24b56a43a4c2a0b0e56ec734711ec615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Barna?= Date: Fri, 28 Oct 2016 11:52:38 +0200 Subject: [PATCH] Hack some poorly implemented serializer. TODO: this breaks everything --- models.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/models.py b/models.py index 8c1ca0e..0f2d5ec 100644 --- a/models.py +++ b/models.py @@ -17,5 +17,8 @@ class Duck( Base ): color = sa.Column( sa.String ) def __repr__(self): - return "" % ( - self.name, self.fullname, self.password) + return '{"duck_id": "'+ ( str( self.duck_id ) or '0' ) +'", "name": "'+ self.name +'", "color": "'+ self.color +'" }' + + def __init__(self, name, color): + self.name = name + self.color = color