[WIP] Testing and reformuling
This commit is contained in:
6
app/api/config/cruds/path/create.py
Normal file
6
app/api/config/cruds/path/create.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from sqlalchemy.orm import Session
|
||||
from .....schema.config.path import Path
|
||||
|
||||
def create(session:Session, path:Path):
|
||||
session.add(path)
|
||||
session.commit()
|
||||
7
app/api/config/cruds/path/delete.py
Normal file
7
app/api/config/cruds/path/delete.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from .....schema.config.path import Path
|
||||
|
||||
def delete(session:Session, path:Path):
|
||||
session.delete(path)
|
||||
session.commit()
|
||||
10
app/api/config/cruds/path/read.py
Normal file
10
app/api/config/cruds/path/read.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import os
|
||||
from sqlalchemy.orm import Session
|
||||
from sqlalchemy import select
|
||||
|
||||
from .....schema.config.path import Path
|
||||
|
||||
def read(session:Session, _id:int):
|
||||
stmt = select(Path).where(Path.id == _id)
|
||||
path:Path = session.scalars(stmt).one()
|
||||
return path
|
||||
7
app/api/config/cruds/path/update.py
Normal file
7
app/api/config/cruds/path/update.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import os
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from .....schema.config.path import Path
|
||||
|
||||
def update(session:Session, path:Path):
|
||||
session.commit()
|
||||
Reference in New Issue
Block a user