Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_buttons(self) -> t.List[deform.form.Button]:
buttons = (
deform.form.Button("add"),
deform.form.Button("cancel"),
)
return buttons
def get_buttons(self) -> t.List[deform.form.Button]:
buttons = (
deform.form.Button("add"),
deform.form.Button("cancel"),
)
return buttons
def get_buttons(self) -> t.Iterable[deform.form.Button]:
return (
deform.form.Button("save"),
deform.form.Button("cancel"),
)
def get_buttons(self) -> t.Iterable[deform.form.Button]:
return (
deform.form.Button("save"),
deform.form.Button("cancel"),
)
form_view = self.form_view_class(request)
schema = self.wizard.schemas[step]
self.schema = schema.bind(request=request)
form_view.schema = self.schema
buttons = []
prev_disabled = False
next_disabled = False
if hasattr(schema, 'prev_ok'):
prev_disabled = not schema.prev_ok(request)
if hasattr(schema, 'next_ok'):
next_disabled = not schema.next_ok(request)
prev_button = Button(name='previous', title='Previous',
disabled=prev_disabled)
next_button = Button(name='next', title='Next',
disabled=next_disabled)
done_button = Button(name='next', title='Done',
disabled=next_disabled)
if step > 0:
buttons.append(prev_button)
if step < len(self.wizard.schemas)-1:
buttons.append(next_button)
else:
buttons.append(done_button)
form_view.buttons = buttons
form_view.next_success = self.next_success
self.schema = schema.bind(request=request)
form_view.schema = self.schema
buttons = []
prev_disabled = False
next_disabled = False
if hasattr(schema, 'prev_ok'):
prev_disabled = not schema.prev_ok(request)
if hasattr(schema, 'next_ok'):
next_disabled = not schema.next_ok(request)
prev_button = Button(name='previous', title='Previous',
disabled=prev_disabled)
next_button = Button(name='next', title='Next',
disabled=next_disabled)
done_button = Button(name='next', title='Done',
disabled=next_disabled)
if step > 0:
buttons.append(prev_button)
if step < len(self.wizard.schemas)-1:
buttons.append(next_button)
else:
buttons.append(done_button)
form_view.buttons = buttons
form_view.next_success = self.next_success
form_view.previous_success = self.previous_success
form_view.previous_failure = self.previous_failure