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 fa4465a commit 9a6a638
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ def __init__(self, *args, **kwargs):

def __str__(self):
"""Returns a string representation of the instance"""
cls = (str(type(self)).split('.')[-1]).split('\'')[0]
obj = self.to_dict()
del obj['__class__']
return '[{}] ({}) {}'.format(cls, obj['id'], obj)
return '[{}] ({}) {}'.format(self.__class__.__name__,
self.id, self.__dict__)

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

0 comments on commit 9a6a638

Please sign in to comment.