Just a quick report on the status on pymssql backend, after being busy for nearly 2 weeks, today I finally found a big trunk of time (~10 hrs) to hack it, and the result is that there are only 4 errors (shown below) out of all Django doctests left. :-) Anyway it's late night already and my mind started to blur. I will try to finish up tomorrow, clean up, and submit patches.

Please NOTE that this pymssql is different with the existing ado_mssql. It can run on *nix, 'coz I am hacking on my Mac.

Cheers.
- Cheng Zhang

-----
'basic' module: API test raised an exception
============================================
Code: 'a101.save()'
Line: 162
Exception: File "/Users/czhang/project/workspace/svk/django_trunk/ tests/doctest.py", line 1243, in __run
    compileflags, 1) in test.globs
  File "<doctest basic[63]>", line 1, in ?
    a101.save()
File "/Users/czhang/Library/Python/2.4/site-packages/django/utils/ functional.py", line 3, in _curried return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items())) File "/Users/czhang/Library/Python/2.4/site-packages/django/core/ meta/__init__.py", line 1029, in method_save
    ','.join(placeholders)), db_values)
File "/Users/czhang/Library/Python/2.4/site-packages/django/core/ db/base.py", line 15, in execute
    raise e
Exception: ("internal error: None (SQL Server message 544, state 1, severity 16:\nCannot insert explicit value for identity column in table 'basic_articles' when IDENTITY_INSERT is set to OFF.\n), sql=INSERT INTO [basic_articles] ([headline],[pub_date],id) VALUES ('Article 101','2005-07-31 12:30:45',101), operation=INSERT INTO [basic_articles] ([headline],[pub_date],id) VALUES (%s,%s,%s), params= ['Article 101', '2005-07-31 12:30:45', 101]", 'INSERT INTO [basic_articles] ([headline],[pub_date],id) VALUES (%s,%s,%s)', "['Article 101', '2005-07-31 12:30:45', 101]")


'basic' module: API test raised an exception
============================================
Code: 'a101 = articles.get_object(pk=101)'
Line: 163
Exception: File "/Users/czhang/project/workspace/svk/django_trunk/ tests/doctest.py", line 1243, in __run
    compileflags, 1) in test.globs
  File "<doctest basic[64]>", line 1, in ?
    a101 = articles.get_object(pk=101)
File "/Users/czhang/Library/Python/2.4/site-packages/django/utils/ functional.py", line 3, in _curried return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items())) File "/Users/czhang/Library/Python/2.4/site-packages/django/core/ meta/__init__.py", line 1360, in function_get_object raise does_not_exist_exception, "%s does not exist for %s" % (opts.object_name, kwargs)
ArticleDoesNotExist: Article does not exist for {'pk': 101}


'subclassing' module: API test failed
=====================================
Code: 'a3.pub_date'
Line: 66
Expected: 'datetime.date(2005, 8, 22)\n'
Got: 'datetime.datetime(2005, 8, 22, 0, 0)\n'

'subclassing' module: API test failed
=====================================
Code: 'a4.pub_date'
Line: 86
Expected: 'datetime.date(2005, 8, 22)\n'
Got: 'datetime.datetime(2005, 8, 22, 0, 0)\n'
4 errors:
-----


On Jan 11, 2006, at 4:28 AM, Cheng Zhang wrote:


On Jan 10, 2006, at 10:21 PM, Adrian Holovaty wrote:


On 1/9/06, Rich Bakos <[EMAIL PROTECTED]> wrote:
I am experimenting with Django and MS SQL and it appears that Django is
passing parameters to MS SQL in an incorrect format.

The params are being passed in as a format string style (%s), which MS
SQL chokes on.

Hey Rich,

The Django MS SQL support is still in alpha status, mostly because we
don't have many people who've tried to use it with MS SQL. We're very
keen on getting that driver up to speed, though, and you can help.

Could you paste the entire traceback you get? Also, would any other MS
SQL users in the audience be able to help?

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org

As matter of fact, I am trying to make pymssql backend for Django work since in my current project we have to inherit a MS-SQL database. Changing the database is definitely not an option. If Django can be used with MS-SQL, then I can convince the team to pick it. Otherwise most likely we will have to stuck with Java/ Structs/iBatis stack which I am not a fan of.

I get the patch for pymssql from Jakub Labath, who was also in the mailing list couple months ago but didn't have time to work more on it. The reason for picking pymssql over ado-mysql is that we'd like to run Django on Linux instead of Windows.

Anyway, at this point I am kind of walking in the dark, since MS- SQL is a new territory to me.

- Cheng


Reply via email to