Exemple #1
0
class MainHeaderViewlet(grok.Viewlet):
    grok.order(20)

    def update(self):
        self.form = BasicForm(self.context, self.request)
        self.form.update()

        # Defines the placeholder for some field
        widgets_placeholder = ('fromDate', 'toDate', 'nearTo')
        for widget in self.form.widgets:
            if widget in widgets_placeholder:
                label = self.form.widgets[widget].label
                self.form.widgets[widget].placeholder = label
Exemple #2
0
    def update(self):
        self.form = BasicForm(self.context, self.request)
        self.form.update()

        # Defines the placeholder for some field
        widgets_placeholder = ('fromDate', 'toDate', 'nearTo')
        for widget in self.form.widgets:
            if widget in widgets_placeholder:
                label = self.form.widgets[widget].label
                self.form.widgets[widget].placeholder = label