updated login/select

This commit is contained in:
2025-01-27 21:43:36 +03:00
parent b88f910a43
commit c0bd9c1685
18 changed files with 257 additions and 275 deletions

View File

@@ -29,9 +29,7 @@ class RedisResponse:
def as_dict(self) -> Dict:
data = self.all
main_dict = {
"status": self.status,
"message": self.message,
"count": self.count,
"status": self.status, "message": self.message, "count": self.count,
"dataType": getattr(self, "data_type", None),
}
if isinstance(data, RedisRow):
@@ -49,7 +47,6 @@ class RedisResponse:
@property
def count(self) -> int:
print()
row = self.all
if isinstance(row, list):
return len(row)
@@ -57,13 +54,13 @@ class RedisResponse:
return 1
@property
def first(self) -> Union[RedisRow, None]:
def first(self) -> Union[RedisRow, dict, None]:
if self.data:
if isinstance(self.data, list):
if isinstance(self.data[0], RedisRow):
return self.data[0].row
return self.data[0]
elif isinstance(self.data, RedisRow):
return self.row
return self.data.row
self.status = False
return