Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
269 B
2
Indexable
Never
import conn
from conn import Animals, session
from main import Animal

class AnimalRepo:

    def add_to_database(self, animal):

        session.add(animal)
        return session.commit()


service = AnimalRepo()
cat = Animal('Nutka', 5)

service.add_to_database(cat)