Index: /main/waeup.sirp/branches/ulif-fasttables/src/waeup/sirp/jambtables/interfaces.py
===================================================================
--- /main/waeup.sirp/branches/ulif-fasttables/src/waeup/sirp/jambtables/interfaces.py	(revision 5318)
+++ /main/waeup.sirp/branches/ulif-fasttables/src/waeup/sirp/jambtables/interfaces.py	(revision 5319)
@@ -23,7 +23,27 @@
 """
 from waeup.sirp.interfaces import IWAeUPObject
+from zc.sourcefactory.basic import BasicSourceFactory
 from zope.interface import Interface
 from zope import schema
 
+class GenderSource(BasicSourceFactory):
+    """A gender source delivers basically a mapping
+       ``{'m': 'male', 'f': 'female'}``
+
+       Using a source, we make sure that the tokens (which are
+       stored/expected for instance from CSV files) are something one
+       can expect and not cryptic IntIDs.
+    """
+    def getValues(self):
+        return ['m', 'f']
+
+    def getToken(self, value):
+        return value[0].lower()
+        
+    def getTitle(self, value):
+        if value == 'm':
+            return 'male'
+        if value == 'f':
+            return 'female'
 
 class IJAMBDataTable(IWAeUPObject):
@@ -77,9 +97,12 @@
         required=False,
         )
-        
-class IApplicant(IWAeUPObject):
-    """An applicant.
-
-
+
+class IApplicantBaseData(IWAeUPObject):
+    """The data for an applicant.
+
+    This is a base interface with no field (except ``reg_no``)
+    required. For use with importers, forms, etc., please use one of
+    the derived interfaces below, which set more fields to required
+    state, depending on use-case.
     """
     reg_no = schema.TextLine(
@@ -88,4 +111,5 @@
     access_code = schema.TextLine(
         title = u'Access Code',
+        required = False,
         )
     serial = schema.TextLine(
@@ -95,4 +119,5 @@
     course1 = schema.TextLine(
         title = u'1st Choice Course of Study',
+        required = False,
         )
     course2 = schema.TextLine(
@@ -106,10 +131,13 @@
     firstname = schema.TextLine(
         title = u'First Name',
+        required = False,
         )
     middlenames = schema.TextLine(
         title = u'Middle Names',
+        required = False,
         )
     lastname = schema.TextLine(
         title = u'Surname/Full Name',
+        required = False,
         )
     jamb_age = schema.Int(
@@ -119,18 +147,24 @@
     date_of_birth = schema.Date(
         title = u'Date of Birth',
+        required = False,
         )
     jamb_state = schema.TextLine(
         title = u'State (provided by JAMB)',
+        required = False,
         )
     jamb_lga = schema.TextLine(
         title = u'LGA (provided by JAMB)',
+        required = False,
         )
     lga = schema.TextLine(
         # XXX: should be choice
         title = u'State/LGA (confirmed by applicant)',
+        required = False,
         )
     sex = schema.Choice(
         title = u'Sex',
-        values = [u'female', u'male']
+        source = GenderSource(),
+        default = u'm',
+        required = False,
         )
     email = schema.TextLine(
@@ -145,4 +179,5 @@
         title = u'Passport Photograph',
         default = True,
+        required = False,
         )
     aos = schema.TextLine(
@@ -198,4 +233,5 @@
     fst_sit_fname = schema.TextLine(
         title = u'Full Name',
+        required = False,
         )
     fst_sit_no = schema.TextLine(
@@ -212,10 +248,4 @@
         required = False,
         )
-    #fst_sit_results = schema.TextLine(
-    #    # XXX: Should be nested list of choices
-    #    title = u'Results',
-    #    required = False,
-    #    )
-    
     fst_sit_results = schema.List(
         title = u'Results',
@@ -224,29 +254,10 @@
             title = u'Entries',
             schema = IResultEntry,
+            required = False,
             )
         )
-    
-    #fst_sit_results = schema.Object(
-    #    title = u'Results',
-    #    required = False,
-    #    schema = IResultEntry,
-    #    )
-
-    #fst_sit_results = schema.Dict(
-    #    title = u'Results',
-    #    required = False,
-    #    key_type = schema.TextLine(
-    #        title = u'Subject',
-    #        ),
-    #    value_type = schema.TextLine(
-    #        title = u'Score',
-    #        ),
-    #    )
-
-    #
-    # Second sitting data
-    #
     scd_sit_fname = schema.TextLine(
         title = u'Full Name',
+        required = False,
         )
     scd_sit_no = schema.TextLine(
@@ -294,18 +305,23 @@
     application_date = schema.Date(
         title = u'Application Date',
+        required = False,
         )
     status = schema.TextLine(
         # XXX: should be 'status' type
         title = u'Application Status',
+        required = False,
         )
     screening_date = schema.Date(
         title = u'Screening Date',
+        required = False,
         )
     screening_type = schema.TextLine(
         # XXX: schould be choice
         title = u'Screening Type',
+        required = False,
         )
     screening_score = schema.TextLine(
         title = u'Screening Score',
+        required = False,
         )
     screening_venue = schema.TextLine(
@@ -336,5 +352,5 @@
         # XXX: should have sensible default: upcoming session
         title = u'Entry Session',
-        required = True,
+        required = False,
         )
     notice = schema.Text(
@@ -348,15 +364,179 @@
     import_record_no = schema.TextLine(
         title = u'Import Record No.',
+        required = False,
         )
     imported_by = schema.TextLine(
         title = u'Imported By',
+        required = False,
         )
     import_date = schema.Datetime(
         title = u'Import Date',
+        required = False,
         )
     import_from = schema.TextLine(
         title = u'Import Source',
-        )
-
+        required = False,
+        )
+
+    
+class IApplicant(IApplicantBaseData):
+    """An applicant.
+
+    This is basically the applicant base data. Here we repeat the
+    fields from base data only with the `required` attribute of
+    required attributes set to True (which is the default).
+    """
+    access_code = schema.TextLine(
+        title = u'Access Code',
+        )
+    course1 = schema.TextLine(
+        title = u'1st Choice Course of Study',
+        )
+    firstname = schema.TextLine(
+        title = u'First Name',
+        )
+    middlenames = schema.TextLine(
+        title = u'Middle Names',
+        )
+    lastname = schema.TextLine(
+        title = u'Surname/Full Name',
+        )
+    date_of_birth = schema.Date(
+        title = u'Date of Birth',
+        )
+    jamb_state = schema.TextLine(
+        title = u'State (provided by JAMB)',
+        )
+    jamb_lga = schema.TextLine(
+        title = u'LGA (provided by JAMB)',
+        )
+    lga = schema.TextLine(
+        # XXX: should be choice
+        title = u'State/LGA (confirmed by applicant)',
+        )
+    sex = schema.Choice(
+        title = u'Sex',
+        source = GenderSource(),
+        default = u'm',
+        )
+    passport = schema.Bool(
+        title = u'Passport Photograph',
+        default = True,
+        )
+    #
+    # Higher Educational Data
+    #
+
+    #
+    # First sitting data
+    #
+    fst_sit_fname = schema.TextLine(
+        title = u'Full Name',
+        )
+
+    #
+    # Second sitting data
+    #
+    scd_sit_fname = schema.TextLine(
+        title = u'Full Name',
+        )
+    #
+    # JAMB scores
+    #
+    
+    #
+    # Application Data
+    #
+    application_date = schema.Date(
+        title = u'Application Date',
+        )
+    status = schema.TextLine(
+        # XXX: should be 'status' type
+        title = u'Application Status',
+        )
+    screening_date = schema.Date(
+        title = u'Screening Date',
+        )
+    screening_type = schema.TextLine(
+        # XXX: schould be choice
+        title = u'Screening Type',
+        )
+    screening_score = schema.TextLine(
+        title = u'Screening Score',
+        )
+    entry_session = schema.TextLine(
+        # XXX: should be choice
+        # XXX: should have sensible default: upcoming session
+        title = u'Entry Session',
+        )
+    import_record_no = schema.TextLine(
+        title = u'Import Record No.',
+        )
+    imported_by = schema.TextLine(
+        title = u'Imported By',
+        )
+    import_date = schema.Datetime(
+        title = u'Import Date',
+        )
+    import_from = schema.TextLine(
+        title = u'Import Source',
+        )
+
+class IApplicantPDEImportData(IApplicantBaseData):
+    """Data for applicants, that passed PDE screening.
+
+    This data set should be suitable for imports from JAMB tables. It
+    is also basicall the basic applicant data from
+    :class:`IApplicantBaseData` only with the required fields set.
+
+    """
+    firstname = schema.TextLine(
+        title = u'First Name',
+        required = True,
+        )
+    middlenames = schema.TextLine(
+        title = u'Middle Names',
+        required = True,
+        )
+    lastname = schema.TextLine(
+        title = u'Surname/Full Name',
+        required = True,
+        )
+    date_of_birth = schema.Date(
+        title = u'Date of Birth',
+        required = True,
+        )
+    jamb_state = schema.TextLine(
+        title = u'State (provided by JAMB)',
+        required = True,
+        )
+    jamb_lga = schema.TextLine(
+        title = u'LGA (provided by JAMB)',
+        required = True,
+        )
+    course1 = schema.TextLine(
+        title = u'1st Choice Course of Study',
+        required = True,
+        )
+    screening_date = schema.Date(
+        title = u'Screening Date',
+        required = True,
+        )
+    screening_type = schema.TextLine(
+        # XXX: schould be choice
+        title = u'Screening Type',
+        required = True,
+        )
+    screening_venue = schema.TextLine(
+        title = u'Screening Venue',
+        required = True,
+        )
+    entry_session = schema.TextLine(
+        # XXX: should be choice
+        # XXX: should have sensible default: upcoming session
+        title = u'Entry Session',
+        required = True,
+        )
+    
 class IApplicantContainer(IWAeUPObject):
     """A container for applicants.
