updated login/select
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user