#12731: Manager.raw() doesn't work with Multi-table inheritance
------------------------------------------+---------------------------------
 Reporter:  [email protected]        |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Database layer (models, ORM)  |     Version:  SVN       
 Keywords:  raw                           |       Stage:  Unreviewed
Has_patch:  0                             |  
------------------------------------------+---------------------------------
 As far as I can tell the Manager.raw() function does not work with a
 subclassed model.  I believe the raw function is looking for an 'id'
 field, and this does not exist in a subclassed table (instead of id, there
 is a <parent>_ptr_id field).

 example:


 {{{
 class Parent(models.Model)
  name = models.CharField(max_length=50)

 class Child(Parent)
  favorite_toy = models.CharField(max_length=50)

 # broken code
 Child.objects.raw("SELECT * FROM child")
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12731>
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.

Reply via email to