Hi All!

Stepped on a bug today: someone sanitizes the data when it goes to an
edit form. I have a textarea and the text with several sequential
newlines, and every that sequence is replaced by one newline!

My code is tooo simple:

class EditNodeForm(TableForm):
    class fields(WidgetsList):
        id = HiddenField()
        title = TextField
(label_text=u'Title',size=64,validator=NotEmpty())
        content = TextArea(label_text=u'Text',validator=NotEmpty
(),attrs={'cols':'80', 'rows':'20'})
        _method = HiddenField(attrs={'value':'PUT'})

edit_node_form = EditNodeForm("EditNodeForm")

------

    # Displays an 'Edit' form
    @without_trailing_slash
    @expose('pyramid.templates.node.new')
    @require(not_anonymous())
    def edit(self, id, **kwargs):
        tmpl_context.form_widget = edit_node_form
        value = DBSession.query(self.base_entity).get(id)
        return dict(form_value=value, form_action=url(self.base_url),
model_root=url(self.base_url))

----

The template just contains something like
${XML(tmpl_context.form_widget(value=form_value, .....


Well, where are my newlines? I need two, not one (to separate
paragraphs with markdown)

--
    Sergei

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to