semvec/pypi-packages huggingface dataset:
sanic-admin-api 1.0
sanic api
License: MIT License
Requires Python: >=3.6

```python
#table_field.py
from sanic_admin_api.utils.table_utils import FormatColumns,ForeignKey,CharField
class Player(FormatColumns):
    table_name = "player"
    verbose_name = "web tablename(table1)"
    foreign_key_name = "Name_J"
    primary_key= "PlayerID"
    def __init__(self):
        Kind_Choice = {1:"children", 2:"youth"}
        self.PlayerID = CharField(is_edit=False, verbose_name = "Id")
        self.Kind = CharField(verbose_name = "type", choice_field = Kind_Choice)
        self.Name_J = CharField(verbose_name = "chinese")
        self.Name_E = CharField(verbose_name = "english")


class Table2(FormatColumns):
    verbose_name = "web tablename(table2)"
    table_name = "table2"
    primary_key = "id"
    def __init__(self):
        self.id = CharField(is_edit=False, verbose_name = "Id")
        self.fromTableId = ForeignKey(self, Table, key_name = "fromTableName", verbose_name = "PlayerID", as_table_name = "fromTable")
        self.toTableId = ForeignKey(self, Table, key_name="toTableName", verbose_name="Id", as_table_name = "toTable")



```



```python
#create views player
#views/player.py

from sanic import Blueprint
from sanic_admin_api.views.public_view import PublicList,ObjView
from table_field import Player

player_bp = Blueprint('player', url_prefix = "/player")



class PlayerList(PublicList):
    #max_page_size = 50
    table = Player()
    serach_field = ("PlayerID", "Name_J", "Name_E",)


class PlyerObj(ObjView):
    table = Player()


player_bp.add_route(PlayerList.as_view(), "")
player_bp.add_route(PlyerObj.as_view(), "/<obj_id>")
```



```

http://127.0.0.1/player?keyword=Nicholas&page=10&page_size=100

http://127.0.0.1/player/888

GET
POST
PUT
DELETE

```