diff --git a/webserver/models/line_order.py b/webserver/models/line_order.py index aad7854..04c9918 100644 --- a/webserver/models/line_order.py +++ b/webserver/models/line_order.py @@ -18,4 +18,6 @@ def to_dict(self, dishes=True): my_dict['id'] = self.id my_dict['dish'] = self.dish.to_dict() - my_dict['quantity'] = self.quantity \ No newline at end of file + my_dict['quantity'] = self.quantity + + return my_dict \ No newline at end of file diff --git a/webserver/models/order.py b/webserver/models/order.py index dff33ef..ce5494c 100644 --- a/webserver/models/order.py +++ b/webserver/models/order.py @@ -33,6 +33,7 @@ def to_dict(self, lines_order=True, state=True): my_dict['state'] = self.state.to_dict() if self.state else None if lines_order: - my_dict['lines_orders'] = [so.to_dict() for so in self.lines_order] + print self.lines_order[0] + my_dict['lines_orders'] = [lo.to_dict() for lo in self.lines_order] return my_dict \ No newline at end of file