Skip to content

Commit

Permalink
fix dict problem line_order
Browse files Browse the repository at this point in the history
  • Loading branch information
william57m committed Nov 6, 2014
1 parent 032f663 commit 945a73c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion webserver/models/line_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
my_dict['quantity'] = self.quantity

return my_dict
3 changes: 2 additions & 1 deletion webserver/models/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 945a73c

Please sign in to comment.