Return a JSON representation of a card
(self)
| 18 | return '<Card (%d): %s>' % (self.id, self.text) |
| 19 | |
| 20 | def json(self): |
| 21 | """Return a JSON representation of a card""" |
| 22 | return { |
| 23 | 'id': self.id, |
| 24 | 'text': self.text, |
| 25 | 'column': self.column, |
| 26 | 'color': self.color, |
| 27 | 'modified': self.modified.replace(tzinfo=timezone.utc).isoformat(), |
| 28 | 'archived': self.archived, |
| 29 | } |
| 30 | |
| 31 | def all_cards(): |
| 32 | """Return JSON for all cards, sorted by the order_by attribute""" |