You’d think this would be a no-brainer.
I used to_csv
on the DB rows & got it into a variable (who knows what type it is??!!!).
Then I’ve tried to convert it to everything from blobs to bytes to . . whatever so when I pass it to the client I can downlaod the csv.
I’m getting lazymedia
acusations and 100 others.
Just be great sometiems if you guys would have a FULL example of somethign as simple as this.
What do I do? Please.
SERVER
tblAsCSV = app_tables.test_sentences_tbl.search().to_csv()
csv_media = anvil.BlobMedia('text/plain', tblAsCSV.encode(), name=tblName + '.csv')
return csv_media
CLIENT
csv_media = anvil.server.call('exportDB', tblType)
csvFile = anvil.BlobMedia('text/plain', csv_media, name=tblType + '.csv')
# bytes(tblAsCSV, 'utf-8')
anvil.media.download(csvFile)