1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 11:34:18 +00:00

Start work on medals

This commit is contained in:
Steffo 2019-08-03 15:29:41 +02:00
parent 04d360c20f
commit 7ee84abb56

View file

@ -0,0 +1,27 @@
"""A :py:class:`royalnet.web.Royalprint` to create and award :py:class:`royalnet.database.tables.Medal`s."""
import flask as f
import os
import typing
from ...royalprint import Royalprint
from ...shortcuts import error
from ....database.tables import *
from ....utils.wikirender import prepare_page_markdown, RenderError
# Maybe some of these tables are optional...
tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates')
rp = Royalprint("medals", __name__, url_prefix="/medals", template_folder=tmpl_dir,
required_tables={Royal, ActiveKvGroup, Alias, Diario, Discord, Keygroup, Keyvalue, Telegram, WikiPage,
WikiRevision, Bio})
@rp.route("/create", methods=["GET", "POST"], defaults={"medal_id": None})
@rp.route("/<int:medal_id>/edit", methods=["GET", "POST"])
def medal_edit(medal_id: typing.Optional[int]):
...
@rp.route("/<int:medal_id>/award", methods=["GET", "POST"])
def medal_award(medal_id: int):
...