Hi,
I'm working on the Django adapter again, and have
run into a snag. I think the Python MonetDB wrapper
may need a new method, but before building a patch
I wanted to share the idea and get your feedback.
The issue is this: Django uses the field type SafeUnicode.
Monetizer doesn't have a mapping for this, and thus
raises a ProgrammerError exception. (This is unicode
that is safe to disply on an HTML page, and is used for
all slug fields, which are common in Django.)
The SQLite adapter handles this via a register_adapter
method on the Database object. PostgreSQL uses
psycopg2.extensions.register_adapter().
MySQL Python adapter exposes a encoders() method
on the connection object.
It seems the cleanest solution would be to mimic
SQLite (if you want this for one connection, you most
likely want it for all connections), and be able to do
something like this:
Database.register_adapter(
type(SafeUnicode),
lambda s:unicode(s)
)
But it wasn't clear to me how to implement this. Somehow
that call needs to make it into Montizer mapping dictionary.
Thanks,
Mark
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Monetdb-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-developers