Re: [Django] #9362: InlineAdminForm breaks content_type FK on model

2009-04-08 Thread Django
#9362: InlineAdminForm breaks content_type FK on model
---+
  Reporter:  carljm| Owner:  carljm
Status:  assigned  | Milestone:  1.1   
 Component:  django.contrib.admin  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by carljm):

  * status:  new => assigned

-- 
Ticket URL: 
Django 
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-updates@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
-~--~~~~--~~--~--~---



Re: [Django] #9362: InlineAdminForm breaks content_type FK on model

2009-03-29 Thread Django
#9362: InlineAdminForm breaks content_type FK on model
---+
  Reporter:  carljm| Owner:  carljm
Status:  new   | Milestone:  1.1   
 Component:  django.contrib.admin  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by carljm):

 Better patch attached after discussion with brosner.  Includes test.

-- 
Ticket URL: 
Django 
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-updates@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
-~--~~~~--~~--~--~---



Re: [Django] #9362: InlineAdminForm breaks content_type FK on model

2009-03-29 Thread Django
#9362: InlineAdminForm breaks content_type FK on model
---+
  Reporter:  carljm| Owner:  carljm
Status:  new   | Milestone:  1.1   
 Component:  django.contrib.admin  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by carljm):

  * owner:  brosner => carljm
  * status:  assigned => new

-- 
Ticket URL: 
Django 
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-updates@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
-~--~~~~--~~--~--~---



Re: [Django] #9362: InlineAdminForm breaks content_type FK on model

2009-03-14 Thread Django
#9362: InlineAdminForm breaks content_type FK on model
---+
  Reporter:  carljm| Owner:  brosner
Status:  assigned  | Milestone:  1.1
 Component:  django.contrib.admin  |   Version:  1.0
Resolution:|  Keywords: 
 Stage:  Accepted  | Has_patch:  1  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Changes (by jacob):

  * milestone:  => 1.1

-- 
Ticket URL: 
Django 
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-updates@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
-~--~~~~--~~--~--~---



Re: [Django] #9362: InlineAdminForm breaks content_type FK on model

2009-03-11 Thread Django
#9362: InlineAdminForm breaks content_type FK on model
---+
  Reporter:  carljm| Owner:  brosner
Status:  assigned  | Milestone: 
 Component:  django.contrib.admin  |   Version:  1.0
Resolution:|  Keywords: 
 Stage:  Accepted  | Has_patch:  1  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Comment (by patrickk):

 is it impolite to ask, whether or not this is going to be fixed ... and
 when?
 the fix seems to be easy and the current behaviour is extremely annoying.

-- 
Ticket URL: 
Django 
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-updates@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
-~--~~~~--~~--~--~---



Re: [Django] #9362: InlineAdminForm breaks content_type FK on model

2009-01-10 Thread Django
#9362: InlineAdminForm breaks content_type FK on model
---+
  Reporter:  carljm| Owner:  brosner
Status:  assigned  | Milestone: 
 Component:  django.contrib.admin  |   Version:  1.0
Resolution:|  Keywords: 
 Stage:  Accepted  | Has_patch:  1  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Changes (by airrob):

 * cc: airrob (added)

-- 
Ticket URL: 
Django 
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-updates@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
-~--~~~~--~~--~--~---



Re: [Django] #9362: InlineAdminForm breaks content_type FK on model

2008-10-14 Thread Django
#9362: InlineAdminForm breaks content_type FK on model
---+
  Reporter:  carljm| Owner:  brosner
Status:  assigned  | Milestone: 
 Component:  django.contrib.admin  |   Version:  1.0
Resolution:|  Keywords: 
 Stage:  Accepted  | Has_patch:  1  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Changes (by isometry):

 * cc: isometry (added)

-- 
Ticket URL: 
Django 
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-updates@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: [Django] #9362: InlineAdminForm breaks content_type FK on model

2008-10-14 Thread Django
#9362: InlineAdminForm breaks content_type FK on model
---+
  Reporter:  carljm| Owner:  brosner
Status:  assigned  | Milestone: 
 Component:  django.contrib.admin  |   Version:  1.0
Resolution:|  Keywords: 
 Stage:  Accepted  | Has_patch:  1  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Changes (by brosner):

  * owner:  nobody => brosner
  * status:  new => assigned
  * stage:  Unreviewed => Accepted

-- 
Ticket URL: 
Django 
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-updates@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: [Django] #9362: InlineAdminForm breaks content_type FK on model

2008-10-14 Thread Django
#9362: InlineAdminForm breaks content_type FK on model
---+
  Reporter:  carljm| Owner:  nobody
Status:  new   | Milestone:
 Component:  django.contrib.admin  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by carljm):

  * needs_better_patch:  => 0
  * has_patch:  0 => 1
  * needs_tests:  => 0
  * needs_docs:  => 0

-- 
Ticket URL: 
Django 
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-updates@googlegroups.com
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
-~--~~~~--~~--~--~---



[Django] #9362: InlineAdminForm breaks content_type FK on model

2008-10-14 Thread Django
#9362: InlineAdminForm breaks content_type FK on model
--+-
 Reporter:  carljm|   Owner:  nobody
   Status:  new   |   Milestone:
Component:  django.contrib.admin  | Version:  1.0   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 r8586 fixed "View on Site" links for admin inline formsets, by having
 {{{InlineAdminForm.__init__}}} set a temporary "content_type_id" attribute
 on the inline-edited "original" instance to the content type id of its
 model, and then using that attribute in the template to link to the
 redirection.

 This is all fine and dandy, except when the model being edited inline
 already has a "content_type" field which is a foreign key to !ContentType
 (most likely because it has a generic foreign key).  In this case,
 !InlineAdminForm reassigns an already-existing "content_type_id" attribute
 to point to the wrong model entirely, breaking any behavior of the
 instance that depends on the generic foreign key.

 This behavior can be seen with these test models:

 {{{
 from django.db import models
 from django.contrib.contenttypes.models import ContentType
 from django.contrib.contenttypes import generic

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

 def __unicode__(self):
 return self.name

 class Teacher(models.Model):
 name = models.CharField(max_length=50)

 def __unicode__(self):
 return self.name

 class Child(models.Model):
 name = models.CharField(max_length=50)
 teacher = models.ForeignKey(Teacher)

 content_type = models.ForeignKey(ContentType)
 object_id = models.PositiveIntegerField()
 parent = generic.GenericForeignKey()

 def __unicode__(self):
 return u'I am %s, a child of %s' % (self.name, self.parent)
 }}}

 With this admin configuration:

 {{{
 from django.contrib import admin
 from models import Child, Teacher, Parent

 class ChildInline(admin.TabularInline):
 model = Child
 extra = 1

 class TeacherAdmin(admin.ModelAdmin):
 inlines = (ChildInline,)

 admin.site.register(Teacher, TeacherAdmin)
 admin.site.register(Parent)
 }}}

 In the admin, create a Parent named John, then create a Teacher named
 Sally, then add a Child named Joe using the inline formset for the
 Teacher.  After saving the Child, where the new Child's __unicode__
 representation should be displayed as "I am Joe, a child of John", it will
 instead say "I am Joe, a child of I am Joe, a child of John".  This is
 because InlineAdminForm has changed Joe's content_type_id from Parent to
 Child, so Joe's "parent" attribute is now pointing to himself.

 (The reason for the Teacher model and FK in the above examples is to make
 it clear that this occurs with any ordinary InlineAdmin, not only with a
 GenericInlineAdmin).

 The easy fix is to use a more obscure attribute name for the temporary "my
 content type" attribute needed for redirection.  Technically it would
 still be possible to mistakenly overwrite an existing attribute, but much
 less likely than it is now.

-- 
Ticket URL: 
Django 
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-updates@googlegroups.com
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
-~--~~~~--~~--~--~---