Skip to content

Commit

Permalink
Task 07
Browse files Browse the repository at this point in the history
  • Loading branch information
OluwaninsolaAO committed Apr 23, 2023
1 parent 9a6a638 commit 5838c91
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ def __init__(self, *args, **kwargs):

def __str__(self):
"""Returns a string representation of the instance"""
obj = self.__dict__.copy()
try:
del obj['_sa_instance_state']
except KeyError:
pass
return '[{}] ({}) {}'.format(self.__class__.__name__,
self.id, self.__dict__)
self.id, obj)

def save(self):
"""Updates updated_at with current time when instance is changed"""
Expand Down

0 comments on commit 5838c91

Please sign in to comment.