remove unnecessary wrap_form.

svn path=/plone.app.discussion/trunk/; revision=28358
This commit is contained in:
Timo Stollenwerk 2009-08-04 19:30:12 +00:00
parent c0d7f326b2
commit ae0b9486b7

View File

@ -199,7 +199,7 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
# a cancel button that is handled by a jQuery method. # a cancel button that is handled by a jQuery method.
pass pass
class ViewletFormWrapper(ViewletBase, layout.FormWrapper): class CommentsViewlet(ViewletBase, layout.FormWrapper):
form = CommentForm form = CommentForm
@ -207,7 +207,7 @@ class ViewletFormWrapper(ViewletBase, layout.FormWrapper):
return ViewPageTemplateFile('comments.pt').__of__(self)(self) return ViewPageTemplateFile('comments.pt').__of__(self)(self)
def __init__(self, context, request, view, manager): def __init__(self, context, request, view, manager):
super(ViewletFormWrapper, self).__init__(context, request, view, manager) super(CommentsViewlet, self).__init__(context, request, view, manager)
if self.form is not None: if self.form is not None:
self.form_instance = self.form(self.context.aq_inner, self.request) self.form_instance = self.form(self.context.aq_inner, self.request)
self.form_instance.__name__ = self.__name__ self.form_instance.__name__ = self.__name__
@ -299,6 +299,4 @@ class ViewletFormWrapper(ViewletBase, layout.FormWrapper):
# before we can call toLocalizedTime. # before we can call toLocalizedTime.
util = getToolByName(self.context, 'translation_service') util = getToolByName(self.context, 'translation_service')
zope_time = DateTime(time.year, time.month, time.day, time.hour, time.minute, time.second) zope_time = DateTime(time.year, time.month, time.day, time.hour, time.minute, time.second)
return util.toLocalizedTime(zope_time, long_format=True) return util.toLocalizedTime(zope_time, long_format=True)
CommentsViewlet = layout.wrap_form(CommentForm, __wrapper_class=ViewletFormWrapper)