Уведомления

Группа в Telegram: @pythonsu

#1 Фев. 4, 2011 11:08:07

svas
От:
Зарегистрирован: 2010-01-27
Сообщения: 239
Репутация: +  9  -
Профиль   Отправить e-mail  

mssql 'SQLCompiler' object has no attribute '_using_row_number'

Нужно использовать raw sql
Модель

class AccountTableNot(models.Model):
account = models.IntegerField()
class Meta:
db_table = u'AccountTableNot'
Во view
...
print AccountTableNot.objects.raw('SELECT * FROM AccountTableNot')[0]
...
Вылазит ошибка
Request Method: GET
Request URL: http://localhost:8000/
Django Version: 1.2.3
Python Version: 2.6.1
Installed Applications:
['testproject.testapp']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "" in get_response
100. response = callback(request, *callback_args, **callback_kwargs)
File "" in index
9. print AccountTableNot.objects.raw('SELECT * FROM AccountTableNot')[0]
File "" in resolve_columns
48. if self._using_row_number:

Exception Type: AttributeError at /
Exception Value: 'SQLCompiler' object has no attribute '_using_row_number'
В чем проблема? Неправильный код или проблема в django-mssql?



Офлайн

#2 Фев. 4, 2011 14:28:17

svas
От:
Зарегистрирован: 2010-01-27
Сообщения: 239
Репутация: +  9  -
Профиль   Отправить e-mail  

mssql 'SQLCompiler' object has no attribute '_using_row_number'

Похоже проблема в django-mssql
http://code.google.com/p/django-mssql/issues/detail?id=91
Пока изменил код как поменял его другой человек



Офлайн

Board footer

Модераторировать

Powered by DjangoBB

Lo-Fi Version