I'm working with a MySQL database where the primary key (resourceid) is a 
binary(16).  According to the developer guide this binary(16) is a UUID. 

Playing around a bit in python I found that uuid.UUID(bytes=resourceid) decodes 
things properly.

The problem is I'm attempting sprox + CrudRestController is throwing this error:

Module sprox.fillerbase:219 in get_value     

<<inline: plus.jpg>>

     view
>>  value = unicode(value, encoding='utf-8')

UnicodeDecodeError: 'utf8' codec can't decode byte 0x96 in position 39: 
unexpected code byte

Debugging at the traceback here is what I have for the variable value:

'<div><div><a class="edit_link" href="\x0c\x15\x96\xe2}C@\'\xab\x 
12\xe0\xcb\xd9\xe0+\x00/1/edit" 
style="text-decoration:none">edit</a></div><div><form method="POST" 
action="\x0c\x15\x96\xe2}C@\'\xab\x12\xe0\xcb\xd9\xe0+\x00/1" 
class="button-to"><input type="hidden" name="_method" value="DELETE" /><input 
class="delete-button" onclick="return confirm(\'Are you sure?\');" 
value="delete" type="submit" style="background-color: transparent; float:left; 
border:0; color: #286571; display: inline; margin: 0; padding: 
0;"/></form></div></div>'

Using MySQL WorkBench and getting the first row and view the resourceid in the 
"Value Viewer" as "Binary" I see this:

0c 15 86 e2 7d 43 40 27 ab 12 e- cb d9 e0 2b 00

Looks just like the values after the "href="

Finally the question.

How can I decode and encode the resourceid so sprox can use it in my 
CrudRestController?

One answer might be "don't use sprox" and hand write the CRUD by hand. I'd 
prefer not not.

I cannot alter the database as another commerical application is writing to 
this table and I do not have the ability to alter the commericial application.

Thanks.
--
Bob Tanner <[email protected]>                 | Phone : 952-943-8700
http://www.real-time.com, Linux, OSX, VMware | Fax      : 952-943-8500
Key fingerprint = F785 DDFC CF94 7CE8 AA87 3A9D 3895 26F1 0DDB E378

Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to