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:
parent
04d360c20f
commit
7ee84abb56
1 changed files with 27 additions and 0 deletions
27
royalnet/web/royalprints/medals/__init__.py
Normal file
27
royalnet/web/royalprints/medals/__init__.py
Normal 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):
|
||||||
|
...
|
Loading…
Reference in a new issue