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

Commit

Permalink
sql : new AnonMsg model
Browse files Browse the repository at this point in the history
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
  • Loading branch information
Ari Archer committed May 9, 2023
1 parent bf2ba44 commit 5462889
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion awc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from . import const, exc, util

__version__: typing.Final[str] = "2.0.0"
__version__: typing.Final[str] = "3.0.0"


class Awc:
Expand Down
3 changes: 1 addition & 2 deletions awc/sql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,8 @@ class AnonMsg(SQLTable):
tname: str = "anon"
t: pypika.Table = pypika.Table(tname)

cid: pypika.Column = t.cid # type: ignore
ip: pypika.Column = t.ip # type: ignore
content: pypika.Column = t.content # type: ignore
headers: pypika.Column = t.headers # type: ignore


def sql(query: pypika.queries.QueryBuilder) -> str:
Expand Down
4 changes: 2 additions & 2 deletions awc/sql/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_anon_msg(ip: str) -> typing.List[pypika.queries.QueryBuilder]:
ip: str -- content id ( ip )
return typing.List[pypika.queries.QueryBuilder] -- the queries"""
return [AnonMsg.select(AnonMsg.cid == ip, AnonMsg.content)] # type: ignore
return [AnonMsg.select(AnonMsg.ip == ip, AnonMsg.content)] # type: ignore


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

0 comments on commit 5462889

Please sign in to comment.