-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdata.py
44 lines (32 loc) · 889 Bytes
/
data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:Mod: about
:Synopsis:
:Author:
servilla
:Created:
6/3/21
"""
import fastapi
from fastapi_chameleon import template
from starlette.requests import Request
from viewmodels.shared.viewmodel import ViewModelBase
from viewmodels.data.tombstone_viewmodel import TombstoneViewModel
router = fastapi.APIRouter()
@router.get('/data/publish-data')
@template("data/publish-data.html")
def publish(request: Request):
vm = ViewModelBase(request, "Publish Data")
return vm.to_dict()
@router.get('/data/find-data')
@template("data/find-data.html")
def find(request: Request):
vm = ViewModelBase(request, "Find Data")
return vm.to_dict()
@router.get('/data/tombstone')
@template("data/tombstone.html")
def find(request: Request):
vm = TombstoneViewModel(request, "Tombstone")
vm.load()
return vm.to_dict()