| 1 |
from Products.Archetypes.public import * |
from Products.Archetypes.public import * |
| 2 |
from Products.Archetypes.TemplateMixin import TemplateMixin |
from Products.Archetypes.TemplateMixin import TemplateMixin |
|
from Products.Archetypes.SQLStorage import PostgreSQLStorage |
|
| 3 |
|
|
| 4 |
from Products.PACDefault.config import * |
from Products.PACDefault.config import * |
| 5 |
|
|
| 8 |
StringField('salutation', |
StringField('salutation', |
| 9 |
vocabulary=AR_SALUTATION_LIST, |
vocabulary=AR_SALUTATION_LIST, |
| 10 |
widget=SelectionWidget(), |
widget=SelectionWidget(), |
|
storage=PostgreSQLStorage(), |
|
| 11 |
searchable=1, |
searchable=1, |
| 12 |
), |
), |
| 13 |
StringField('firstName', |
StringField('firstName', |
| 14 |
widget=StringWidget(label='First Name'), |
widget=StringWidget(label='First Name'), |
|
storage=PostgreSQLStorage(), |
|
| 15 |
searchable=1, |
searchable=1, |
| 16 |
), |
), |
| 17 |
StringField('middleName', |
StringField('middleName', |
| 18 |
widget=StringWidget(label='Middle Name/Initial'), |
widget=StringWidget(label='Middle Name/Initial'), |
|
storage=PostgreSQLStorage(), |
|
| 19 |
searchable=1, |
searchable=1, |
| 20 |
), |
), |
| 21 |
StringField('lastName', |
StringField('lastName', |
| 22 |
widget=StringWidget(label='Last Name'), |
widget=StringWidget(label='Last Name'), |
|
storage=PostgreSQLStorage(), |
|
| 23 |
searchable=1, |
searchable=1, |
| 24 |
), |
), |
| 25 |
StringField('nickName', |
StringField('nickName', |
| 26 |
widget=StringWidget(label='Nick Name'), |
widget=StringWidget(label='Nick Name'), |
|
storage=PostgreSQLStorage(), |
|
| 27 |
searchable=1, |
searchable=1, |
| 28 |
), |
), |
| 29 |
# CurrentOffice for politicians |
# CurrentOffice for politicians |
| 30 |
StringField('currentPosition', |
StringField('currentPosition', |
| 31 |
widget=StringWidget(label='Current Position'), |
widget=StringWidget(label='Current Position'), |
|
storage=PostgreSQLStorage(), |
|
| 32 |
searchable=1, |
searchable=1, |
| 33 |
index="FieldIndex", |
index="FieldIndex", |
| 34 |
), |
), |
| 35 |
# Empty for non-government |
# Empty for non-government |
| 36 |
StringField('currentDistrict', |
StringField('currentDistrict', |
| 37 |
widget=StringWidget(label='Current District'), |
widget=StringWidget(label='Current District'), |
|
storage=PostgreSQLStorage(), |
|
| 38 |
searchable=1, |
searchable=1, |
| 39 |
index="FieldIndex", |
index="FieldIndex", |
| 40 |
), |
), |
| 41 |
# US Government or company name |
# US Government or company name |
| 42 |
StringField('organization', |
StringField('organization', |
| 43 |
widget=StringWidget(label='Organization'), |
widget=StringWidget(label='Organization'), |
|
storage=PostgreSQLStorage(), |
|
| 44 |
searchable=1, |
searchable=1, |
| 45 |
index="FieldIndex", |
index="FieldIndex", |
| 46 |
), |
), |
| 47 |
StringField('firstElected', |
StringField('firstElected', |
| 48 |
widget=StringWidget(label='First Elected'), |
widget=StringWidget(label='First Elected'), |
|
storage=PostgreSQLStorage(), |
|
| 49 |
searchable=1, |
searchable=1, |
| 50 |
), |
), |
| 51 |
StringField('lastElected', |
StringField('lastElected', |
| 52 |
widget=StringWidget(label='Last Elected'), |
widget=StringWidget(label='Last Elected'), |
|
storage=PostgreSQLStorage(), |
|
| 53 |
searchable=1, |
searchable=1, |
| 54 |
), |
), |
| 55 |
StringField('nextElection', |
StringField('nextElection', |
| 56 |
widget=StringWidget(label='Next Election'), |
widget=StringWidget(label='Next Election'), |
|
storage=PostgreSQLStorage(), |
|
| 57 |
searchable=1, |
searchable=1, |
| 58 |
), |
), |
| 59 |
StringField('politicalParty', |
StringField('politicalParty', |
| 60 |
widget=SelectionWidget(label='Political Party'), |
widget=SelectionWidget(label='Political Party'), |
| 61 |
vocabulary='getPoliticalParties', |
vocabulary='getPoliticalParties', |
|
storage=PostgreSQLStorage(), |
|
| 62 |
index="FieldIndex", |
index="FieldIndex", |
| 63 |
searchable=1, |
searchable=1, |
| 64 |
), |
), |
| 65 |
# mmm, True == Male (of course, since I'm a guy) |
# mmm, True == Male (of course, since I'm a guy) |
| 66 |
# BooleanField('gender', |
# BooleanField('gender', |
| 67 |
# widget=BooleanWidget(label='Gender'), |
# widget=BooleanWidget(label='Gender'), |
|
# storage=PostgreSQLStorage(), |
|
| 68 |
# ), |
# ), |
| 69 |
StringField('gender', |
StringField('gender', |
| 70 |
widget=SelectionWidget(label='Gender'), |
widget=SelectionWidget(label='Gender'), |
| 71 |
vocabulary='getGenders', |
vocabulary='getGenders', |
|
storage=PostgreSQLStorage(), |
|
| 72 |
index='FieldIndex', |
index='FieldIndex', |
| 73 |
searchable=1, |
searchable=1, |
| 74 |
), |
), |
| 75 |
LinesField('family', |
LinesField('family', |
| 76 |
widget=LinesWidget(label='Family'), |
widget=LinesWidget(label='Family'), |
|
storage=PostgreSQLStorage(), |
|
| 77 |
searchable=1, |
searchable=1, |
| 78 |
), |
), |
| 79 |
StringField('birthdate', |
StringField('birthdate', |
| 80 |
widget=StringWidget(label='Birthdate'), |
widget=StringWidget(label='Birthdate'), |
|
storage=PostgreSQLStorage(), |
|
| 81 |
searchable=1, |
searchable=1, |
| 82 |
), |
), |
| 83 |
StringField('birthplace', |
StringField('birthplace', |
| 84 |
widget=StringWidget(label='Birthplace'), |
widget=StringWidget(label='Birthplace'), |
|
storage=PostgreSQLStorage(), |
|
| 85 |
searchable=1, |
searchable=1, |
| 86 |
), |
), |
| 87 |
StringField('homeCity', |
StringField('homeCity', |
| 88 |
widget=StringWidget(label='Home City'), |
widget=StringWidget(label='Home City'), |
|
storage=PostgreSQLStorage(), |
|
| 89 |
searchable=1, |
searchable=1, |
| 90 |
), |
), |
| 91 |
# Some sort of selection widget? Perhaps something stored in pac_tool or |
# Some sort of selection widget? Perhaps something stored in pac_tool or |
| 92 |
# pac_properties? |
# pac_properties? |
| 93 |
StringField('religion', |
StringField('religion', |
| 94 |
widget=StringWidget(label='Religion'), |
widget=StringWidget(label='Religion'), |
|
storage=PostgreSQLStorage(), |
|
| 95 |
searchable=1, |
searchable=1, |
| 96 |
index="FieldIndex", |
index="FieldIndex", |
| 97 |
), |
), |
| 98 |
LinesField('education', |
LinesField('education', |
| 99 |
widget=LinesWidget(label='Education'), |
widget=LinesWidget(label='Education'), |
|
storage=PostgreSQLStorage(), |
|
| 100 |
searchable=1, |
searchable=1, |
| 101 |
index="FieldIndex", |
index="FieldIndex", |
| 102 |
), |
), |
| 103 |
LinesField('professionalExperience', |
LinesField('professionalExperience', |
| 104 |
widget=LinesWidget(label='Professional Experience'), |
widget=LinesWidget(label='Professional Experience'), |
|
storage=PostgreSQLStorage(), |
|
| 105 |
searchable=1, |
searchable=1, |
| 106 |
index="FieldIndex", |
index="FieldIndex", |
| 107 |
), |
), |
| 108 |
LinesField('politicalExperience', |
LinesField('politicalExperience', |
| 109 |
widget=LinesWidget(label='Political Experience'), |
widget=LinesWidget(label='Political Experience'), |
|
storage=PostgreSQLStorage(), |
|
| 110 |
searchable=1, |
searchable=1, |
| 111 |
index="FieldIndex", |
index="FieldIndex", |
| 112 |
), |
), |
| 113 |
LinesField('organizations', |
LinesField('organizations', |
| 114 |
widget=LinesWidget(label='Organizations'), |
widget=LinesWidget(label='Organizations'), |
|
storage=PostgreSQLStorage(), |
|
| 115 |
searchable=1, |
searchable=1, |
| 116 |
), |
), |
| 117 |
)) + TemplateMixin.schema |
)) + TemplateMixin.schema |
| 118 |
# ImageField('picture', storage=PostgreSQLStorage()), |
# ImageField('picture'), |
| 119 |
|
|
| 120 |
# Setup the title for our purposes |
# Setup the title for our purposes |
| 121 |
schema['title'].mode='r' |
schema['title'].mode='r' |