#12721: PostgreSQL problem deleting objects with GenericRelation and non-integer
object_id
------------------------------------+---------------------------------------
          Reporter:  kmtracey       |         Owner:  carljm
            Status:  assigned       |     Milestone:        
         Component:  Uncategorized  |       Version:  SVN   
        Resolution:                 |      Keywords:        
             Stage:  Unreviewed     |     Has_patch:  1     
        Needs_docs:  0              |   Needs_tests:  0     
Needs_better_patch:  0              |  
------------------------------------+---------------------------------------
Changes (by carljm):

  * owner:  nobody => carljm
  * status:  new => assigned
  * has_patch:  0 => 1

Comment:

 Appears to me that this (unlike #10015) is actually a contenttypes-
 specific issue. It only occurs if a field containing a foreign PK for a
 relation has a different database column type from the PK field it's
 pointing to, and AFAICT GenericRelation is the only case where this can
 happen: ForeignKey and ManyToManyField always use the correct column type.
 I can't recreate the problem without a GenericRelation involved.

 Fix attached that ensures the get_db_prep_value method from the
 appropriate field is called for the PKs before the query goes to the
 database. All tests pass for me on Postgres (barring unrelated failures
 from #12692 and #12724).

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12721#comment:2>
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 django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to