WilliamRen / django-pyodbc

Automatically exported from code.google.com/p/django-pyodbc
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Completely broken in django svn revision 13388 #86

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I just upgraded to django revision 13388, and it dosen't seem to make any 
queries at all with sql_server.pyodbc backend.

eg.

  >>> from django.conf import settings
  >>> from django.db import connections
  >>> settings.DEBUG = True
  >>> MyModel.objects.all()  # There should be many results returned here
  []
  >>> connection['default'].queries # This should also not be blank
  []

Original issue reported on code.google.com by ama...@gmail.com on 19 Jul 2010 at 6:03

GoogleCodeExporter commented 8 years ago
I can get a traceback looking like this when trying to save a UserProfile model 
(which inherits from User)

Environment:

Request Method: GET
Request URL: http://devtest3/intranet_staging/page/5432
Django Version: 1.3 pre-alpha SVN-13388
Python Version: 2.6.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.admin',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'intranet',
 'intranet.search',
 'intranet.house_scores',
 'intranet.booking',
 'intranet.dropbox',
 'intranet.drug_alcohol',
 'intranet.event_manager',
 'intranet.bookmarks',
 'intranet.synergetic',
 'intranet.quick_vote',
 'intranet.av_booking',
 'intranet.database',
 'intranet.professional_learning',
 'intranet.error_report',
 'intranet.id_lookup',
 'intranet.assist',
 'intranet.typing_test',
 'intranet.filebrowser',
 'intranet.util',
 'intranet.parent_teacher_timer',
 'south']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'intranet.integrated_auth.RemoteUserAuthMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'intranet.exception_middleware.ExceptionMiddleware',
 'django.middleware.transaction.TransactionMiddleware')

Traceback:
File "E:\django_projects\intranet_staging\django\core\handlers\base.py" in 
get_response
  80.                     response = middleware_method(request)
File "E:\django_projects\intranet_staging\intranet\integrated_auth.py" in 
process_request
  354.         login(request, v)
File "E:\django_projects\intranet_staging\django\contrib\auth\__init__.py" in 
login
  69.     user.save()
File "E:\django_projects\intranet_staging\django\db\models\base.py" in save
  435.         self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "E:\django_projects\intranet_staging\django\db\models\base.py" in save_base
  479.                 self.save_base(cls=parent, origin=org, using=using)
File "E:\django_projects\intranet_staging\django\db\models\base.py" in save_base
  497.                         manager.using(using).filter(pk=pk_val).exists())):
File "E:\django_projects\intranet_staging\django\db\models\query.py" in exists
  496.             return self.query.has_results(using=self.db)
File "E:\django_projects\intranet_staging\django\db\models\sql\query.py" in 
has_results
  417.         return bool(compiler.execute_sql(SINGLE))
File "E:\django_projects\intranet_staging\django\db\models\sql\compiler.py" in 
execute_sql
  717.             sql, params = self.as_sql()
File "C:\Python26\lib\site-packages\sql_server\pyodbc\compiler.py" in as_sql
  282.             sql, params = self._as_sql(USE_ROW_NUMBER)
File "C:\Python26\lib\site-packages\sql_server\pyodbc\compiler.py" in _as_sql
  199.         if self.query.extra_where:

Exception Type: AttributeError at /page/5432
Exception Value: 'Query' object has no attribute 'extra_where'

Original comment by ama...@gmail.com on 19 Jul 2010 at 10:59

GoogleCodeExporter commented 8 years ago
I'm pretty sure this has been fixed in newer versions of django-pyodbc for a 
while now.

Original comment by rlaa...@gmail.com on 19 Oct 2010 at 4:00