[Python] django_cubrid can not be a engine for django 1.5
Test Environment:
{noformat}
python: 2.7.3
django: 1.5
cubrid: 9.1.0.0205
cubrid python: 9.1.0.001
{noformat}
After deploy the django web server, there are some errors when select the tuples:
1. When execute install sql, it success, and the database also has the created table.
{noformat}
[bom@NC-PL-QA-012 ~]$ python manage.py sqlall messages
BEGIN;
CREATE TABLE `messages_message` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`name` varchar(30) NOT NULL,
`email` varchar(75) NOT NULL,
`homepage` varchar(200) NOT NULL,
`title` varchar(200) NOT NULL,
`content` varchar(500) NOT NULL,
`time` datetime NOT NULL,
`ip` varchar(20) NOT NULL
)
;
COMMIT;
[bom@NC-PL-QA-012 ~]$python manage.py syncdb
{noformat}
2. When executing python manage.py shell command, there are some errors:
from messages.models import Message
expected:
{noformat}
Message.objects.all()
[]
{noformat}
actual:
{noformat}
Message.objects.all()
Traceback (most recent call last):
File console, line 1, in module
File /home/bom/tools/python273/lib/python2.7/site-packages/django/db/models/query.py, line 77, in __repr__
data = list(self[:REPR_OUTPUT_SIZE + 1])
File /home/bom/tools/python273/lib/python2.7/site-packages/django/db/models/query.py, line 116, in _result_iter
upper = len(self._result_cache)
TypeError: object of type 'NoneType' has no len()
{noformat}
Then insert a tuple successfully, and csql can select this tuple:
{noformat}
m = Message(name='Hily',
email='hily@test.com',
homepage='http://hily.me/',
title='My first message',
content='This is my first message.',
ip='192.168.1.5')
m.save()
{noformat}
When I want to get a value, error occurs:
{noformat}
m = Message.objects.get(name='Hily')
Traceback (most recent call last):
File console, line 1, in module
File /home/bom/tools/python273/lib/python2.7/site-packages/django/db/models/manager.py, line 143, in get
return self.get_query_set().get(*args, **kwargs)
File /home/bom/tools/python273/lib/python2.7/site-packages/django/db/models/query.py, line 394, in get
num = len(clone)
File /home/bom/tools/python273/lib/python2.7/site-packages/django/db/models/query.py, line 90, in __len__
self._result_cache = list(self.iterator())
File /home/bom/tools/python273/lib/python2.7/site-packages/django/db/models/query.py, line 301, in iterator
for row in compiler.results_iter():
File /home/bom/tools/python273/lib/python2.7/site-packages/django/db/models/sql/compiler.py, line 775, in results_iter
for rows in self.execute_sql(MULTI):
File /home/bom/tools/python273/lib/python2.7/site-packages/django/db/models/sql/compiler.py, line 830, in execute_sql
sql, params = self.as_sql()
File /home/bom/tools/python273/lib/python2.7/site-packages/django_cubrid/compiler.py, line 43, in as_sql
grouping, gb_params = self.get_grouping()
TypeError: get_grouping() takes exactly 2 arguments (1 given)
{noformat}
*The django 1.4.2 is not existed this issue*