This repository has been archived by the owner on Dec 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
interfaces.py
140 lines (107 loc) · 3.76 KB
/
interfaces.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
##############################################################################
#
# Copyright (c) 2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Person Interfaces
$Id$
"""
__docformat__ = "reStructuredText"
import zope.interface
import zope.schema
from z3c.form import interfaces
# ----[ Wizard Interfaces ]---------------------------------------------------
class ISaveButton(interfaces.IButton):
"""A button that causes the step data to be saved."""
class IBackButton(interfaces.IButton):
"""A button that returns to some previous state or screen."""
class IForwardButton(interfaces.IButton):
"""A button that returns to some next state or screen."""
class IStep(zope.interface.Interface):
"""An interface marking a step sub-form."""
def isComplete():
"""Determines whether a step is complete."""
class IWizard(zope.interface.Interface):
"""An interface marking the controlling wizard form."""
def isComplete():
"""Determines whether the wizard is complete."""
def getCurrentStep():
"""Return the current step as an instance."""
def isFirstStep():
"""Determine whether the current step is the first one."""
def isLastStep():
"""Determine whether the current step is the last one."""
# ----[ Content Interfaces ]--------------------------------------------------
class IAddress(zope.interface.Interface):
street = zope.schema.TextLine(
title=u'Street',
description=u'The street address.',
default=u'',
missing_value=u'',
required=True)
zip = zope.schema.TextLine(
title=u'Zip',
description=u'The zip code of the location.',
default=u'',
missing_value=u'',
required=True)
city = zope.schema.TextLine(
title=u'City',
description=u'The city.',
default=u'',
missing_value=u'',
required=True)
class IPersonalInfo(IAddress):
lastName = zope.schema.TextLine(
title=u'Last Name',
description=u'The last name of the person.',
default=u'',
missing_value=u'',
required=True)
firstName = zope.schema.TextLine(
title=u'First Name',
description=u'The first name of the person.',
default=u'',
missing_value=u'',
required=True)
phone = zope.schema.TextLine(
title=u'Phone',
description=u'The phone number.',
default=u'',
missing_value=u'',
required=False)
email = zope.schema.TextLine(
title=u'Email',
description=u'The email address.',
required=False)
class IEmployerInfo(IAddress):
name = zope.schema.TextLine(
title=u'Name',
description=u'The name of the employer.',
default=u'',
missing_value=u'',
required=True)
class IPerson(IPersonalInfo):
father = zope.schema.Object(
title=u'Father',
description=u"Father's personal info.",
schema=IPersonalInfo,
required=True)
mother = zope.schema.Object(
title=u'Mother',
description=u"Mother's personal info.",
schema=IPersonalInfo,
required=True)
employer = zope.schema.Object(
title=u'Mother',
description=u"Mother's personal info.",
schema=IEmployerInfo,
required=True)