#9211: Objects with newlines in representation break popup JavaScript in the
admin
------------------------------------------+---------------------------------
Reporter: jbronn | Owner: nobody
Status: new | Milestone: post-1.0
Component: django.contrib.admin | Version: 1.0
Keywords: admin popup newline carriage | Stage: Unreviewed
Has_patch: 0 |
------------------------------------------+---------------------------------
When you have these models:
{{{
class Note(models.Model):
text = models.TextField()
def __unicode__(self):
return self.text
class Person(models.Model):
name = models.CharField(max_length=25)
note = models.ForeignKey(Note)
def __unicode__(self):
return self.name
}}}
And the following in `admin.py`:
{{{
from django.contrib import admin
from models import Note, Person
admin.site.register(Note)
admin.site.register(Person)
}}}
When entering a `Person` model in the admin a new may `Note` created by
clicking the plus icon next to the selection list. If the person entering
the note presses return and puts newlines in the `TextField`, the
`dismissAddAnotherPopup` JavaScript chokes on the `Notes` representation.
Attached is a patch that escapes carriage returns, however, I want some
discussion on whether there needs to be any other escaping performed.
--
Ticket URL: <http://code.djangoproject.com/ticket/9211>
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
-~----------~----~----~----~------~----~------~--~---