[pypy-dev] PyPy and GeoDjango

Alex Gaynor alex.gaynor at gmail.com
Tue May 10 23:18:43 CEST 2011


On Tue, May 10, 2011 at 5:02 PM, Gasper Zejn <zejn at kiberpipa.org> wrote:

>
> Seeing that there's a postgresql adapter written for PyPy [1], I decided to
> do
> a test-drive on a pet Django project. Had I not used GeoDjango, it would
> have
> probably worked right away.
>
>
> I didn't need to change much: Django's PostGIS database adapter uses a
> psycopg
> extension, psycopg2.extensions.ISQLQuote, which doesn't really provide
> anything useful. However, I'm guessing due to implementation difference,
> original psycopg calls `__conforms__` with extra parameter, while rpython
> implementation does not - that's why there's an `*args`.
>
> The other problem was that CPython ctypes and PyPy ctypes implementations
> differ: where CPython uses `PTR._obj.value`, PyPy uses
> `PTR.contents.value`.
>
>
> The attached patch made my project work both on CPython and PyPy.
>
>
> Regards,
> Gasper Zejn
>
>
> [1] https://bitbucket.org/alex_gaynor/pypy-postgresql/overview
>
> _______________________________________________
> pypy-dev mailing list
> pypy-dev at python.org
> http://mail.python.org/mailman/listinfo/pypy-dev
>
>
The __conform__ thing is a bug in my psycogp2, I'll fix that so it'd be
innapropriate to apply that to django.  The other changes look like Django
relying on internal details of ctypes, the correct fix isn't to add a
special case for another ctypes impl.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20110510/6fb35182/attachment.html>


More information about the pypy-dev mailing list