Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
150 B
2
Indexable
Never
pet = Animal('Emirat', 10)
pet_obj = [vars(pet)]
print(pet_obj)

session.add_all((Animals(**pet) for pet in pet_obj))
session.commit()
session.close()