Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit 5462889

Browse files
author
Ari Archer
committed
sql : new AnonMsg model
Signed-off-by: Ari Archer <[email protected]>
1 parent bf2ba44 commit 5462889

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

awc/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from . import const, exc, util
1313

14-
__version__: typing.Final[str] = "2.0.0"
14+
__version__: typing.Final[str] = "3.0.0"
1515

1616

1717
class Awc:

awc/sql/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,8 @@ class AnonMsg(SQLTable):
143143
tname: str = "anon"
144144
t: pypika.Table = pypika.Table(tname)
145145

146-
cid: pypika.Column = t.cid # type: ignore
146+
ip: pypika.Column = t.ip # type: ignore
147147
content: pypika.Column = t.content # type: ignore
148-
headers: pypika.Column = t.headers # type: ignore
149148

150149

151150
def sql(query: pypika.queries.QueryBuilder) -> str:

awc/sql/helpers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def get_anon_msg(ip: str) -> typing.List[pypika.queries.QueryBuilder]:
108108
ip: str -- content id ( ip )
109109
110110
return typing.List[pypika.queries.QueryBuilder] -- the queries"""
111-
return [AnonMsg.select(AnonMsg.cid == ip, AnonMsg.content)] # type: ignore
111+
return [AnonMsg.select(AnonMsg.ip == ip, AnonMsg.content)] # type: ignore
112112

113113

114114
def del_anon_msg(ip: str) -> typing.List[pypika.queries.QueryBuilder]:
@@ -117,4 +117,4 @@ def del_anon_msg(ip: str) -> typing.List[pypika.queries.QueryBuilder]:
117117
ip: str -- content id ( ip )
118118
119119
return typing.List[pypika.queries.QueryBuilder] -- the queries"""
120-
return [delete(AnonMsg.query(AnonMsg.cid == ip))] # type: ignore
120+
return [delete(AnonMsg.query(AnonMsg.ip == ip))] # type: ignore

0 commit comments

Comments
 (0)