#8566: mark_safe not propagating from widgets to templates
-------------------------------------+--------------------------------------
          Reporter:  agirman         |         Owner:  nobody                   
                        
            Status:  new             |     Milestone:  1.0                      
                        
         Component:  Core framework  |       Version:  SVN                      
                        
        Resolution:                  |      Keywords:  mark_safe, safe string, 
escape, escaping, widgets
             Stage:  Unreviewed      |     Has_patch:  0                        
                        
        Needs_docs:  0               |   Needs_tests:  0                        
                        
Needs_better_patch:  0               |  
-------------------------------------+--------------------------------------
Changes (by agirman):

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

Comment:

 Alright, I should have previewed.  Here is the code in a code block:

 {{{
 class MyWidget(forms.TextInput):
     def __init__(self, *args, **kwargs):
         attrs = kwargs.setdefault('attrs', {})
         attrs['safe_string'] = mark_safe("will o' the wisp")
         attrs['normal_string'] = "cat o' nine tails"
         super(MyWidget, self).__init__(*args, **kwargs)

 w = MyWidget()
 w.render("field_name", "")
 #=> u'<input normal_string="cat o&#39; nine tails" type="text"
 name="field_name" safe_string="will o&#39; the wisp" />'
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8566#comment:1>
Django Code <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