Changes between Initial Version and Version 1 of Ticket #18392, comment 9


Ignore:
Timestamp:
Dec 21, 2015, 10:15:47 AM (8 years ago)
Author:
Tim Graham

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18392, comment 9

    initial v1  
    1515To achieve this django.db.base.cursor should be changed in class DatabaseWrapper function _cursor, (complete function definition here http://pastebin.com/A6dMEMd4):
    1616
    17 ''kwargs = {
    18 
     17{{{
     18'kwargs = {
    1919  "conv": django_conversions,
    2020  "charset": "utf8mb4",
    2121  "use_unicode": True,
    2222}
    23 ''
     23}}}
    2424
    2525Unfortunately this won't work unless we also change MySQLdb.connections class Connection function set_character_set:
     
    2727
    2828Change the two bottom lines to (complete function definition here: http://pastebin.com/AMN1B8za)
    29 
     29{{{
    3030#Hack so data can be decoded/encoded using python's utf8 since
    3131# python does not know about mysql utf8mb4
     
    3737
    3838''self.unicode_literal.charset = charset''
     39}}}
    3940
    40 
    41 This will guarantee you can use special characets like πŸ˜„πŸ˜ƒπŸ˜Šβ˜ΊπŸ˜‰πŸ˜πŸ˜˜πŸ˜š
     41This will guarantee you can use special characters like πŸ˜„πŸ˜ƒπŸ˜Šβ˜ΊπŸ˜‰πŸ˜πŸ˜˜πŸ˜š
    4242
    4343Unlike 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.
Back to Top