• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zopefoundation / z3c.form / 16248976312

02 Jul 2025 05:53AM UTC coverage: 95.275%. Remained the same
16248976312

push

github

icemac
Back to development: 6.1

717 of 800 branches covered (89.63%)

Branch coverage included in aggregate %.

3699 of 3835 relevant lines covered (96.45%)

0.96 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.0
/src/z3c/form/browser/submit.py
1
##############################################################################
2
#
3
# Copyright (c) 2007 Zope Foundation and Contributors.
4
# All Rights Reserved.
5
#
6
# This software is subject to the provisions of the Zope Public License,
7
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11
# FOR A PARTICULAR PURPOSE.
12
#
13
##############################################################################
14
"""Submit Widget Implementation
15

16
$Id$
17
"""
18
__docformat__ = "reStructuredText"
1✔
19
import zope.component
1✔
20
import zope.interface
1✔
21

22
from z3c.form import interfaces
1✔
23
from z3c.form.browser import button
1✔
24
from z3c.form.widget import FieldWidget
1✔
25

26

27
@zope.interface.implementer_only(interfaces.ISubmitWidget)
1✔
28
class SubmitWidget(button.ButtonWidget):
1✔
29
    """A submit button of a form."""
30

31
    klass = 'submit-widget'
1✔
32
    css = 'submit'
1✔
33

34
    def json_data(self):
1✔
35
        data = super().json_data()
×
36
        data['type'] = 'submit'
×
37
        return data
×
38

39

40
@zope.component.adapter(interfaces.IButton, interfaces.IFormLayer)
1✔
41
@zope.interface.implementer(interfaces.IFieldWidget)
1✔
42
def SubmitFieldWidget(field, request):
1✔
43
    submit = FieldWidget(field, SubmitWidget(request))
1✔
44
    submit.value = field.title
1✔
45
    return submit
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc