Changeset 3526 for waeup


Ignore:
Timestamp:
30 Jun 2008, 14:42:56 (16 years ago)
Author:
adiwidjaja
Message:

Checkin of basic structure.

Location:
waeup/trunk/src/waeup
Files:
18 added
4 edited
2 moved

Legend:

Unmodified
Added
Removed
  • waeup/trunk/src/waeup/app.py

    r3521 r3526  
    11import grok
    22from grok import index
    3 from interfaces import IUniversity, IFaculty, IStudent
     3from interfaces import IUniversity
     4from setup import app_setup
    45
    56class University(grok.Application, grok.Container):
     
    910        super(University, self).__init__(**kw)
    1011        self.name = name
     12        app_setup.setup(self)
    1113
    1214class Index(grok.View):
     
    2022    grok.context(University)
    2123    grok.AutoFields(IUniversity)
    22 
    23 class AddFaculty(grok.AddForm):
    24     grok.context(IUniversity)
    25     form_fields = grok.AutoFields(IFaculty)
    26 
    27     @grok.action('Add Faculty')
    28     def addFaculty(self, name, *args, **kw):
    29         new_fac = Faculty(name=name)
    30         self.context[name] = new_fac
    31         self.redirect(self.url(new_fac))
    32 
    33 class Faculty(grok.Container):
    34     grok.implements(IFaculty)
    35 
    36     def __init__(self, name=u'Unnamed Faculty', **kw):
    37         super(Faculty, self).__init__(**kw)
    38         self.name = name
    39 
    40 class FacIndex(grok.DisplayForm):
    41     grok.context(Faculty)
    42     grok.name('index')
    43     form_fields = grok.AutoFields(IFaculty)
    44 
    45 
  • waeup/trunk/src/waeup/app_templates/index.pt

    r3521 r3526  
    99  <h2>Your faculties:</h2>
    1010
    11   <ul tal:repeat="fac view/getFacList">
     11  <ul tal:repeat="fac context/values">
    1212    <li>
    1313      <a href="."
  • waeup/trunk/src/waeup/catalog.py

    r3525 r3526  
    88from hurry.query.query import Query, Text
    99from hurry.query import Eq
    10 from interfaces import IStudent
    1110from app import University
    12 from student import Student
     11from students.interfaces import IStudent
     12from students.student import Student
    1313
    1414class StudentIndexes(grok.Indexes):
  • waeup/trunk/src/waeup/interfaces.py

    r3521 r3526  
    1212        required = True,
    1313        )
    14 
    15 class IFaculty(Interface):
    16     """Representation of a university faculty.
    17     """
    18     name = schema.TextLine(
    19         title = u'Name of Faculty',
    20         default = u'Unnamed',
    21         required = True,
    22         )
    23 
    24 class IStudent(Interface):
    25     """Representation of a student.
    26     """
    27     name = schema.TextLine(
    28         title = u'Name of student',
    29         default = u'Nobody',
    30         required = True,
    31         )
    32 
  • waeup/trunk/src/waeup/students/student.py

    r3522 r3526  
    1010    def __init__(self, a):
    1111        """
     12        TODO: REFACTOR TO IMPORT METHOD
     13        Fields:
    1214                 entry_mode,
    1315                 end_level,
     
    2931                 review_state,
    3032                 perm_address,
    31                  email):
    32         self.entry_mode = entry_mode,
    33         self.end_level = end_level,
    34         self.name = name,
    35         self.jamb_reg_no = jamb_reg_no,
    36         self.level = level,
    37         self.id = id,
    38         self.lga = lga,
    39         self.entry_session = entry_session,
    40         self.matric_no = matric_no,
    41         self.sex = sex,
    42         self.phone = phone,
    43         self.session = session,
    44         self.course = course,
    45         self.mode = mode,
    46         self.faculty = faculty,
    47         self.department = department,
    48         self.verdict = verdict,
    49         self.review_state = review_state,
    50         self.perm_address = perm_address,
    51         self.email = email
     33                 email
    5234
    5335        """
Note: See TracChangeset for help on using the changeset viewer.