Changeset 3526
- Timestamp:
- 30 Jun 2008, 14:42:56 (16 years ago)
- Location:
- waeup/trunk/src/waeup
- Files:
-
- 18 added
- 4 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
waeup/trunk/src/waeup/app.py
r3521 r3526 1 1 import grok 2 2 from grok import index 3 from interfaces import IUniversity, IFaculty, IStudent 3 from interfaces import IUniversity 4 from setup import app_setup 4 5 5 6 class University(grok.Application, grok.Container): … … 9 10 super(University, self).__init__(**kw) 10 11 self.name = name 12 app_setup.setup(self) 11 13 12 14 class Index(grok.View): … … 20 22 grok.context(University) 21 23 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_fac31 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 = name39 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 9 9 <h2>Your faculties:</h2> 10 10 11 <ul tal:repeat="fac view/getFacList">11 <ul tal:repeat="fac context/values"> 12 12 <li> 13 13 <a href="." -
waeup/trunk/src/waeup/catalog.py
r3525 r3526 8 8 from hurry.query.query import Query, Text 9 9 from hurry.query import Eq 10 from interfaces import IStudent11 10 from app import University 12 from student import Student 11 from students.interfaces import IStudent 12 from students.student import Student 13 13 14 14 class StudentIndexes(grok.Indexes): -
waeup/trunk/src/waeup/interfaces.py
r3521 r3526 12 12 required = True, 13 13 ) 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 10 10 def __init__(self, a): 11 11 """ 12 TODO: REFACTOR TO IMPORT METHOD 13 Fields: 12 14 entry_mode, 13 15 end_level, … … 29 31 review_state, 30 32 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 52 34 53 35 """
Note: See TracChangeset for help on using the changeset viewer.