You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cookie-api/cookie_api/commands.py

17 lines
338 B
Python

from apistar import Command
from apistar.backends.sqlalchemy_backend import Session
from cookie_api.models.schema import User
def create_user(session: Session, email, password):
user = User(email, password)
session.add(user)
session.commit()
print('User added')
commands = [
Command('create_user', create_user)
]