mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-06 13:01:50 +02:00
Add __str__ functions to all logged models
This commit is contained in:
parent
71c12b562d
commit
ade3e26b72
1 changed files with 6 additions and 0 deletions
|
@ -336,6 +336,9 @@ class Project(db.Model):
|
|||
return None
|
||||
return data["project_id"]
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
def __repr__(self):
|
||||
return "<Project %s>" % self.name
|
||||
|
||||
|
@ -468,6 +471,9 @@ class Bill(db.Model):
|
|||
else:
|
||||
return 0
|
||||
|
||||
def __str__(self):
|
||||
return "%s for %s" % (self.amount, self.what)
|
||||
|
||||
def __repr__(self):
|
||||
return "<Bill of %s from %s for %s>" % (
|
||||
self.amount,
|
||||
|
|
Loading…
Reference in a new issue