Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Fix a bug on Null pic
  • Loading branch information
HSDSZ authored Jun 15, 2021
1 parent a589996 commit 8738d34
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions SQLiterelated.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,13 @@ def gettitlebybirthday(birthday):
return query.value(0)

def getpixmapbybirthday(birthday):

query = QSqlQuery()
query.exec('SELECT pixmap FROM alldata WHERE birthday = {}'.format(birthday))
query.next()
if query.value(0) != None:
return query.value(0)
pix = query.value(0)
return pix if pix != '' else authorpage
else:
query.exec('SELECT pixmap FROM deleteddata WHERE birthday = {}'.format(birthday))
query.next()
Expand All @@ -150,6 +152,8 @@ def getpixmapbybirthday(birthday):
else:
return authorpage



def getcommentbybirthday(birthday):
query = QSqlQuery()
query.exec('SELECT comment FROM alldata WHERE birthday = {}'.format(birthday))
Expand Down Expand Up @@ -465,7 +469,10 @@ def expandstr(tag):
dbcon = QSqlDatabase.addDatabase("QSQLITE")
dbcon.setDatabaseName('./idearray.db')
dbcon.open()
query = QSqlQuery()
query.exec("SELECT tag FROM alldata ORDER BY link")
while query.next():
print(query.value(0))
# query = QSqlQuery()
# query.exec("SELECT tag FROM alldata ORDER BY link")
# while query.next():
# print(query.value(0))

a = getpixmapbybirthday(20210610202045)
print(a)

0 comments on commit 8738d34

Please sign in to comment.