From c18bebb0ff6a1cd912b5da149fd24da3c425b493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=AB=E4=B9=90=E7=9A=84=E8=80=81=E9=BC=A0=E5=AE=9D?= =?UTF-8?q?=E5=AE=9D?= <42690037+LaoshuBaby@users.noreply.github.com> Date: Mon, 17 Apr 2023 15:38:03 +0800 Subject: [PATCH] feat: limit valid check framework WIP Close #6 --- src/kqs/model_basic.py | 4 ++++ src/kqs/type_element.py | 16 ++++++++++++++++ src/kqs/waifu.py | 6 ++++++ 3 files changed, 26 insertions(+) diff --git a/src/kqs/model_basic.py b/src/kqs/model_basic.py index b75721f..1501de8 100644 --- a/src/kqs/model_basic.py +++ b/src/kqs/model_basic.py @@ -77,3 +77,7 @@ def __init__(self, attrib: Dict[str, str], tag_dict: Dict[str, str]): def flush(self): # 移除自身,但如果有被编辑应给予警告,在force的情况下可以强制从数据库中移除,即调用析构函数 pass + + def is_limit_valid(self): + # conduct check API_LIMIT_MAX_KEY_LENGTH while modify tags + return True diff --git a/src/kqs/type_element.py b/src/kqs/type_element.py index fc12a75..40a6f6d 100644 --- a/src/kqs/type_element.py +++ b/src/kqs/type_element.py @@ -3,6 +3,9 @@ from .model_basic import Base, BaseOsmModel from .type_constraint import Member +# TODO +# limit check should be conduct while modify + class Node(BaseOsmModel): upstream_way: list = [0] @@ -66,6 +69,10 @@ def find_history(self): # return list(Node()) pass + def is_limit_valid(self): + # if len0 and len