[Mpuls-commits] r2146 - wasko/branches/2.0/jmdweb/lib
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Mar 25 10:09:03 CET 2010
Author: torsten
Date: 2010-03-25 10:09:02 +0100 (Thu, 25 Mar 2010)
New Revision: 2146
Modified:
wasko/branches/2.0/jmdweb/lib/validators.py
Log:
Removed unused validators.
Modified: wasko/branches/2.0/jmdweb/lib/validators.py
===================================================================
--- wasko/branches/2.0/jmdweb/lib/validators.py 2010-03-25 09:08:13 UTC (rev 2145)
+++ wasko/branches/2.0/jmdweb/lib/validators.py 2010-03-25 09:09:02 UTC (rev 2146)
@@ -23,200 +23,13 @@
# the Bundesministerium fuer Familie, Senioren, Frauen und Jugend and
# European Social Fund resources.
-import datetime
-import time
-import locale
+from formencode.validators import Bool, String
+from mpulsweb.lib.validators import BaseFormValidator
-import formencode
-from formencode import ForEach
-from formencode.validators import Bool, Int, String
-
-from pylons import g
-from pylons.i18n import _
-
-from mpulsweb.lib.validators import BaseFormValidator, NewPasswordForm, \
- ValidatorStateObject, EditUserGroupForm, NewUserGroupForm, \
- EditSettingsForm, NewUserForm, EditUserForm, DateCheck, TimeCheck, \
- CreateAppointmentForm
-
-
-class MyDateConverter(formencode.validators.FancyValidator):
-
- messages = {
- 'wrong_format': _('Date is invalid')
- }
-
- def _to_python(self, value, state):
- value.strip()
- try:
- try:
- d = time.strptime(value, locale.nl_langinfo(locale.D_FMT))
- except:
- d = time.strptime(value,
- locale.nl_langinfo(locale.D_FMT).lower())
- return datetime.date(d[0], d[1], d[2])
- except:
- raise formencode.Invalid(self.message("wrong_format", state),
- value, state)
-
-
-class CasePartSelectionForm(BaseFormValidator):
-
- documents = Int(if_missing=0)
- appointments = Int(if_missing=1)
- logbook = Int(if_missing=0)
-
-
-for i in xrange(1, 33):
- setattr(CasePartSelectionForm, 'form_section_%02d' % i,
- Int(if_missing=0))
-
-# form_section_0 = Int(if_missing=0)
-# form_section_1 = Int(if_missing=0)
-# form_section_2 = Int(if_missing=0)
-# form_section_3 = Int(if_missing=0)
-# form_section_4 = Int(if_missing=0)
-# form_section_5 = Int(if_missing=0)
-# form_section_6 = Int(if_missing=0)
-# form_section_7 = Int(if_missing=0)
-# form_section_8 = Int(if_missing=0)
-# form_section_9 = Int(if_missing=0)
-# form_section_10 = Int(if_missing=0)
-# form_section_11 = Int(if_missing=0)
-# form_section_12 = Int(if_missing=0)
-# form_section_13 = Int(if_missing=0)
-# form_section_14 = Int(if_missing=0)
-# form_section_15 = Int(if_missing=0)
-# form_section_16 = Int(if_missing=0)
-# form_section_17 = Int(if_missing=0)
-
-
class NewCaseForm(BaseFormValidator):
name = String()
vorname = String()
statement_signed = Bool(if_missing=False)
-class BundleActionForm(BaseFormValidator):
-
- filter_extra_fields = True
-
- all_cases = Int(if_missing=0)
- action = String(not_empty=True)
- case_id = ForEach(Int())
-
-
-class AgencyBundleActionForm(BaseFormValidator):
-
- filter_extra_fields = True
-
- all_cases = Int(if_missing=0)
- action = String(not_empty=True)
- agency_id = ForEach(String())
-
-class KeineAngabe(formencode.validators.FancyValidator):
-
- messages = {
- 'invalid': u'"Keine Angabe" ist keine gültige Angabe.'
- }
-
- def _to_python(self, value, state):
- return value.strip()
-
- def validate_python(self, value, state):
- if value == '-1':
- raise formencode.Invalid(self.message("invalid", state),
- value, state)
-
-
-class SetPhaseForm(BaseFormValidator):
- pass
-
-class ExtraTimeFormValidator1(BaseFormValidator):
-
- allow_extra_fields = True
- filter_extra_fields = True
-
- cm_datum_verlaengerung_1 = DateCheck(not_empty=True)
- cm_bestaet_verlaengerung_1 = String(if_missing='')
- cm_anmerk_verlaengerung_1 = String()
-
-
-class ExtraTimeFormValidator2(BaseFormValidator):
-
- allow_extra_fields = True
- filter_extra_fields = True
-
- cm_datum_verlaengerung_2 = DateCheck(not_empty=True)
- cm_bestaet_verlaengerung_2 = String(if_missing='')
- cm_anmerk_verlaengerung_2 = String()
-
-
-class RenewFormValidator(BaseFormValidator):
-
- allow_extra_fields = True
- filter_extra_fields = True
-
- cm_neuauf_genehm = String()
- anmerkungen = String()
-
-
-class ReopenFormValidator1(BaseFormValidator):
-
- allow_extra_fields = True
- filter_extra_fields = True
-
- cm_wiederauf_genehm_1 = String()
- cm_wiederauf_genehm_datum_1 = DateCheck(not_empty=True)
- cm_wiederauf_datum_bis_1 = DateCheck(not_empty=True)
- anmerkungen = String(not_empty=True)
-
-
-class ReopenFormValidator1abgel(BaseFormValidator):
-
- allow_extra_fields = True
- filter_extra_fields = True
-
- cm_wiederauf_genehm_1 = String()
- cm_wiederauf_genehm_datum_1 = String()
- cm_wiederauf_datum_bis_1 = String()
- anmerkungen = String()
-
-
-class ReopenFormValidator2(BaseFormValidator):
-
- allow_extra_fields = True
- filter_extra_fields = True
-
- cm_wiederauf_genehm_2 = String()
- cm_wiederauf_datum_bis_2 = DateCheck(not_empty=True)
- anmerkungen = String(not_empty=True)
-
-
-class ReopenFormValidator2abgel(BaseFormValidator):
-
- allow_extra_fields = True
- filter_extra_fields = True
-
- cm_wiederauf_genehm_2 = String()
- cm_wiederauf_datum_bis_2 = String()
- anmerkungen = String()
-
-
-class WiederaufnahmeCaseForm(BaseFormValidator):
-
- cm_dok_datum_beendigung = DateCheck(not_empty=True)
- cm_dok_end_verm = String()
- cm_wiederauf_genehm_datum_1 = DateCheck(not_empty=True)
- cm_wiederauf_datum_bis_1 = DateCheck(not_empty=True)
- cm2c_t = String(not_empty=True)
- cm_dok_end_verm = KeineAngabe()
-
-
-class NeuaufnahmeCaseForm(BaseFormValidator):
-
- cm_dok_datum_beendigung = DateCheck(not_empty=True)
- cm_dok_end_sonst = KeineAngabe()
- cm2c_t = String()
-
# vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8
More information about the Mpuls-commits
mailing list