michiya / django-pyodbc-azure

Django backend for Microsoft SQL Server and Azure SQL Database using pyodbc
https://pypi.python.org/pypi/django-pyodbc-azure
BSD 3-Clause "New" or "Revised" License
321 stars 140 forks source link

can work with pypyodbc?? #35

Open JosephkimOS opened 9 years ago

JosephkimOS commented 9 years ago

I am considering to run django on pypy

I tried install django-pyodbc-azure on pypy but faild.

cannot install django-pyodbc-azure with pip

Here is my command and error message (pypyodbc is installed instead pyodbc)

sudo ./pip install django-pyodbc-azure

File "/home/test_user/env/os_mobile_pypy/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py", line 347, in makefile return fileobject(self.connection, mode, bufsize) File "/usr/lib/pypy/lib-python/2.7/socket.py", line 300, in init sock._reuse() File "/home/test_user/env/os_mobile_pypy/site-packages/OpenSSL/SSL.py", line 1148, in getattr return getattr(self._socket, name) AttributeError: '_socketobject' object has no attribute '_reuse'

Storing debug log for failure in /home/joseph/.pip/pip.log

kevin-brown commented 9 years ago

Looks like an OpenSSL (pyOpenSSL?) issue, probably with the pip client.

JosephkimOS commented 9 years ago

@kevin-brown I rewrite source code that replace import pyodbc as Database to import pypyodbc as Database and install setup with "pypy setup.py install" instead using "pip"

now when I run "pypy manage.py" under virtualenv. there is no dependency error like "no package"

However, when I run the server, faced error following,

/site-packages/django_pyodbc_azure-1.8.1.0-py2.7.egg/sql_server/pyodbc/base.py", line 512, in format_row row[i] = f.decode(self.driver_charset) TypeError: 'Row' object does not support item assignment

shaib commented 9 years ago

This seems like you get an import error trying to import the backend.

Try to import it directly in a pypy shell, and see what happens.

JosephkimOS commented 9 years ago

@shaib can import in pypy shell and django as well.

Can generate query set without error however cannot retrieve query set

for example

books = BookModel.objects.all() -> it's okay, print books[0] -> it raises error above I mentioned.