Idris01 / AirBnB_clone

0 stars 1 forks source link

Updated BaseModel to recieve keyword args (kwargs) with instance attributes #22

Closed Idris01 closed 1 year ago

Idris01 commented 1 year ago

Kindly Help review the following Changes

The BaseModel can now recieve a dictionary containing 'id', 'created_at' and 'updated_at' as keyword argument then create a new instance of BaseModel with those attributes.

for example

>>> from model.base_model import BaseModel

>>> model_1 = BaseModel() # model_1 created without any argument
>>> model_2 = BaseModel(**model_1.to_dict()) # model_2 created with the same attributes of model_1
>>> model_1.id == model_2.id
True
>>> model_1.created_at == model_2.created_at
True
Olalekan-1 commented 1 year ago

we can now move to the next tasks. you doing well sir :).