[IronPython] Django 1.1 on IronPython 2.6rc2 findings

Vernon Cole vernondcole at gmail.com
Wed Oct 28 09:23:38 PDT 2009


Markus:
  Would you be so kind as to zip up and email to me the adonet-dbapi as you
now have it patched?
I will create a version which does not error out. (May take a few days.)
--
Vernon

2009/10/28 Markus Törnqvist <mjt at nysv.org>

> On Wed, Oct 28, 2009 at 10:53:45PM +0900, Seo Sanghyeon wrote:
> >Intro... I, together with Mark Rees, wrote most of adonet-dbapi code in
> 2006.
>
> Hi :)
>
> >2009/10/28 Markus Törnqvist <mjt at nysv.org>:
> >> Here's the connect function (in its entirety) from mssql.py
>
> >> def connect(connstr):
> >>    relevant_parts = [part for part in connstr.split(';') if not
> part.upper().startswith('PROVIDER')]
> >>    connstr = ';'.join(relevant_parts)
> >>    #return generic_connect("System.Data",
> "System.Data.SqlClient.SqlConnection", connstr)
>
> >> Way too hacky for my taste but it gets the job kinda done.
> >
> >Indeed. The question is, what underlying Python DB-API 2 driver does
> >django-mssql use? Is it http://pymssql.sourceforge.net/ ?
>
> It's on adonet-dbapi...
>
> >Argument to connect() function in Python DB-API 2 compliant drivers is
> >not standardized. In case of pymssql, it receives keyword arguments,
> >so it should be handled in a manner similar to MySQLdb.py wrapper in
> >adonet-dbapi. But from your hack it seems django-mssql's underlying
> >Python DB-API 2 driver expects a string argument, so django-mssql is
> >building string by itself -- this is ungood. Read psycopg.py wrapper
> >in adonet-dbapi to see how to handle this.
>
> Ok, something like that could be used instead.
>
> >On the other hand, as I understand, Django does not handle paramstyle
> >difference in DB-API 2 drivers, so this is kind of a lost cause. How
> >do other Django DB backends deal with the issue? SQLAlchemy,
> >fortunately, handles paramstyle difference by itself.
>
> I'd have to create the param dict from the connect string, very
> much like your psycopg :)
>
> Django is intended to use the dbapi, I don't think there's any other
> way of handling this?
>
> Anyway, I think the StackOverflowException is a bigger issue :)
>
> --
> mjt
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20091028/de598857/attachment.htm>


More information about the Users mailing list