Changes between Initial Version and Version 1 of Ticket #18392, comment 9
- Timestamp:
- Dec 21, 2015, 10:15:47 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #18392, comment 9
initial v1 15 15 To achieve this django.db.base.cursor should be changed in class DatabaseWrapper function _cursor, (complete function definition here http://pastebin.com/A6dMEMd4): 16 16 17 ''kwargs ={18 17 {{{ 18 'kwargs = { 19 19 "conv": django_conversions, 20 20 "charset": "utf8mb4", 21 21 "use_unicode": True, 22 22 } 23 '' 23 }}} 24 24 25 25 Unfortunately this won't work unless we also change MySQLdb.connections class Connection function set_character_set: … … 27 27 28 28 Change the two bottom lines to (complete function definition here: http://pastebin.com/AMN1B8za) 29 29 {{{ 30 30 #Hack so data can be decoded/encoded using python's utf8 since 31 31 # python does not know about mysql utf8mb4 … … 37 37 38 38 ''self.unicode_literal.charset = charset'' 39 }}} 39 40 40 41 This will guarantee you can use special characets like πππβΊππππ 41 This will guarantee you can use special characters like πππβΊππππ 42 42 43 43 Unlike the previous hack, which worked on reading/writing data, this patch only allows me to read data in utfmb4 format, but now I've hit an error on insertion/creation where I get 'Cursor' object has no attribute '_last_executed'. I will report evidence on this error as I find it. All your help regarding this error is appreciated.