mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add ApiRateLimit SQLAlchemy ORM model
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
2b83d2fb6b
commit
a65a60604a
2 changed files with 55 additions and 0 deletions
15
aurweb/models/api_rate_limit.py
Normal file
15
aurweb/models/api_rate_limit.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
from sqlalchemy.orm import mapper
|
||||
|
||||
from aurweb.schema import ApiRateLimit as _ApiRateLimit
|
||||
|
||||
|
||||
class ApiRateLimit:
|
||||
def __init__(self, IP: str = None,
|
||||
Requests: int = None,
|
||||
WindowStart: int = None):
|
||||
self.IP = IP
|
||||
self.Requests = Requests
|
||||
self.WindowStart = WindowStart
|
||||
|
||||
|
||||
mapper(ApiRateLimit, _ApiRateLimit, primary_key=[_ApiRateLimit.c.IP])
|
Loading…
Add table
Add a link
Reference in a new issue