#12634: sql compiler execute: fetchone empty result with ordering_aliases fail.
---------------------------------------------------+------------------------
Reporter: [email protected] | Owner: nobody
Status: reopened | Milestone: 1.2
Component: Database layer (models, ORM) | Version: 1.2-beta
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Changes (by PyMan):
* status: closed => reopened
* resolution: invalid =>
Comment:
I'm not the original submitter. I'm using django_pyodbc to accesso SQL
Server 2005. So settings.py has sql_server.pyodbc
I have the same problem described above with a similar but different stack
trace (identical last steps). I think I understood better when the
problems occurs.
{{{
class Test(models.Model):
name = models.CharField(max_length=25)
class Test2(models.Model):
id = models.CharField(max_length = 32, primary_key = True)
name = models.CharField(max_length=25)
}}}
Working with Test (a classic django model) there's no problem. When
working with Test2 (see the "id" field as charfield) the problem occurs
when working in some way.
{{{
#WAY1
Test.objects.create(name = "pippo") #It's ok
#----
Test2.objects.create(id = "1", name = "pippo") #Works fine
#WAY2
t = Test.objects.create(name = "pippo")
t.save() #It's ok
#----
t = Test2(id = "2", name = "pippo")
t.save() #Exception as above on "return
cursor.fetchone()[:-len(self.query.ordering_aliases)]"
}}}
I can't avoid using the model and the way of working that causes the
problem (an example is when using a form for model when creating one with
some initial values).
I migrated from Django 1.1.1 to Django 1.2 some weeks ago and only now I
found this problem. I'm sure this thing was working before.
--
Ticket URL: <http://code.djangoproject.com/ticket/12634#comment:10>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.