Changeset 3737 for waeup/branches/hraban/src
- Timestamp:
- 26 Oct 2008, 19:14:17 (16 years ago)
- Location:
- waeup/branches/hraban/src/waeup
- Files:
-
- 4 added
- 52 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/hraban/src/waeup/README.txt
-
Property
svn:keywords
set to
Id
r3523 r3737 1 .. $Id$ 2 1 3 The waeup package 2 4 ******************** -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/__init__.py
-
Property
svn:keywords
set to
Id
r3521 r3737 1 # $Id$ -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/app.py
-
Property
svn:keywords
set to
Id
r3571 r3737 1 # $Id$ 1 2 import grok 2 3 #from zope.interface import Interface … … 17 18 self.__dict__.update(kw) 18 19 19 sc = studentcontainer.StudentContainer() 20 self["students"] = sc 21 22 hc = hostelcontainer.HostelContainer() 23 self["hostels"] = hc 24 25 fc = facultycontainer.FacultyContainer() 26 self["faculties"] = fc 20 self["students"] = studentcontainer.StudentContainer() 21 self["hostels"] = hostelcontainer.HostelContainer() 22 self["faculties"] = facultycontainer.FacultyContainer() 27 23 28 24 #class Content(grok.Viewlet): -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/app_templates/content.pt
-
Property
svn:keywords
set to
Id
r3566 r3737 1 <!-- $Id$ --> 1 2 <ul> 2 3 <li tal:repeat="fac context/values"> -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/app_templates/master.pt
-
Property
svn:keywords
set to
Id
r3530 r3737 2 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3 3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> 4 <!-- $Id$ --> 4 5 <head> 5 6 <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/basecontainer.py
-
Property
svn:keywords
set to
Id
r3571 r3737 1 1 # -*- coding: utf-8 -*- 2 # $Id$ 2 3 import grok 3 4 import os … … 5 6 import waeup.viewlets as vw 6 7 from zope.component import getMultiAdapter 8 from waeup.permissions import * 7 9 8 10 class BaseContainer(grok.Container): … … 20 22 super(BaseContainer, self).__init__() 21 23 self.__dict__.update(kwargs) 22 23 class Content(grok.Viewlet): 24 """ 25 Base viewlet 26 """ 27 grok.viewletmanager(vw.MainArea) 28 grok.view(vw.Index) 29 #grok.order(1) 24 self.ViewPermission = ViewBase 25 self.AddPermission = AddBase 26 self.EditPermission = EditBase 27 28 ## Forms 29 30 class DisplayForm(grok.DisplayForm): 31 grok.template('content') 32 33 def __init__(self, context, request): 34 super(DisplayForm, self).__init__(context, request) 35 self.form_fields = grok.AutoFields(self.context.__class__) 30 36 31 37 class AddForm(grok.AddForm): 32 template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt')) 38 #template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt')) 39 grok.template('edit_form') 33 40 34 41 def __init__(self, context, request): 35 42 super(AddForm, self).__init__(context, request) 43 # ein Objekt der untergeordneten Klasse hinzufügen! 36 44 self.form_fields = grok.AutoFields(self.context.childClass) 37 45 … … 40 48 obj = self.context.childClass(**data) 41 49 id = data['id'].lower() 42 self.context[id] = obj # schlägt fehlt bei nicht-Container-Objekten (not iterable) 50 #print "Add to container %s, ID %s, Obj %s" % (self.context, id, obj) 51 self.context[id] = obj # schlägt fehlt bei falschem Interface! (not iterable) 43 52 self.redirect(self.url('@@index')) 44 53 45 54 class EditForm(grok.EditForm): 46 template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt')) 55 #template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt')) 56 grok.template('edit_form') 47 57 #form_fields = grok.AutoFields(BaseContainer) 48 58 … … 51 61 self.form_fields = grok.AutoFields(self.context.__class__) 52 62 53 def handle_edit_action(self, **data):54 grok.EditForm.handle_edit_action(self, **data)55 self.redirect(self.url('@@index'))63 # def handle_edit_action(self, **data): 64 # grok.EditForm.handle_edit_action(self, **data) 65 # self.redirect(self.url('@@index')) 56 66 67 ## Viewlets 68 69 class DisplayViewlet(grok.Viewlet): 70 grok.viewletmanager(vw.MainArea) 71 grok.context(IBaseContainer) 72 grok.view(vw.Index) 73 74 def update(self): 75 self.form = getMultiAdapter((self.context, self.request), 76 name='displayform') 77 self.form.update_form() 78 79 def render(self): 80 return self.form.render() 81 57 82 class AddViewlet(grok.Viewlet): 58 83 grok.viewletmanager(vw.MainArea) -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/basecontainer_templates/content.pt
-
Property
svn:keywords
set to
Id
r3566 r3737 1 <!-- $Id$ --> 2 <div class="breadcrumbs"> 3 <a href="" tal:attributes="href python:view.url(context.__parent__)"> 4 <span tal:condition="exists:context/__parent__/title" tal:content="context/__parent__/title">Part of</span> 5 <span tal:condition="exists:context/__parent__/name" tal:content="context/__parent__/name">Parent</span> 6 </a> 7 </div> 8 <h2><span tal:condition="exists:context/title" tal:content="context/title">Part of</span> <span tal:content="context/name">Objects</span></h2> 1 9 <div class="menubar"> 2 10 <ul> … … 11 19 </div> 12 20 13 <h2 tal:content="context/name">Objects</h2> 21 <div class="form-fields"> 22 <h3> 23 <tal:block tal:condition="exists:context/childClass/plural_name" ><span tal:content="context/childClass/plural_name">Parts</span> 24 in </tal:block><span tal:condition="exists:context/title" tal:content="context/title">Part of</span> <span tal:content="context/name">Objects</span>: 25 </h3> 14 26 <ul> 15 <li tal:repeat="item context/values"><a tal:condition="exists:item/name" href="" tal:attributes="href python:view.url(item)" tal:content="item/name">Item</a></li> 27 <li tal:repeat="item context/values" class="form-line"> 28 <a tal:condition="exists:item/name" href="" tal:attributes="href python:view.url(item)" tal:content="item/name" class="field">Item</a> 29 </li> 16 30 </ul> 31 </div> 32 33 <div class="form-fields"> 34 <tal:block repeat="widget view/widgets"> 35 <div class="form-line"> 36 <span class="label" tal:content="widget/label">label</span>: 37 <span class="field" tal:content="structure widget">value</span> 38 </div> 39 </tal:block> 40 </div> 41 42 43 <div class="form-fields introspection"> 44 <tal:block repeat="item python:context.__dict__.keys()"> 45 <div class="form-line"> 46 <span class="label" tal:content="item">Key</span>: 47 <span class="field" tal:content="python:context.__dict__[item]">Value</span> 48 </div> 49 </tal:block> 50 </div> -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/basecontainer_templates/edit_form.pt
-
Property
svn:keywords
set to
Id
r3571 r3737 1 <!-- $Id --> 1 2 <form action="." tal:attributes="action request/URL" method="post" class="edit-form" enctype="multipart/form-data"> 2 <!-- 3 <h2 i18n:translate="" 4 tal:condition="view/label" 5 tal:content="view/label">Label</h2> 6 <div class="form-status" 7 tal:define="status view/status" 8 tal:condition="status"> 9 <div i18n:translate="" tal:content="view/status"> 10 Form status summary 3 4 <h2 i18n:translate="" tal:condition="view/label" tal:content="view/label">Label</h2> 5 <div class="form-status" tal:define="status view/status" tal:condition="status"> 6 7 <div i18n:translate="" tal:content="view/status">Form status summary</div> 8 9 <ul class="errors" tal:condition="view/errors"> 10 <li tal:repeat="error view/error_views"> 11 <span tal:replace="structure error">Error Type</span> 12 </li> 13 </ul> 11 14 </div> 12 <ul class="errors" tal:condition="view/errors"> 13 <li tal:repeat="error view/error_views"> 14 <span tal:replace="structure error">Error Type</span> 15 </li> 16 </ul> 17 </div> 18 --> 15 19 16 <div class="form-fields"> 20 17 <tal:block repeat="widget view/widgets"> … … 22 19 <span class="label" tal:define="hint widget/hint"> 23 20 <label tal:condition="python:hint" tal:attributes="for widget/name"> 21 <span i18n:translate="" tal:content="widget/label">label</span> 24 22 <span class="required" tal:condition="widget/required">*</span> 25 <span i18n:translate="" tal:content="widget/label">label</span>26 23 </label> 27 24 <label tal:condition="python:not hint" tal:attributes="for widget/name"> 25 <span i18n:translate="" tal:content="widget/label">label</span> 28 26 <span class="required" tal:condition="widget/required">*</span> 29 <span i18n:translate="" tal:content="widget/label">label</span>30 27 </label> 31 28 </span> -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/baseitem.py
-
Property
svn:keywords
set to
Id
r3571 r3737 1 # baseitem.py 1 # -*- coding: utf-8 -*- 2 # $Id$ 2 3 import os 3 4 import grok … … 5 6 from waeup.interfaces import IBaseItem 6 7 from zope.component import getMultiAdapter 8 from waeup.permissions import * 7 9 8 10 class BaseItem(grok.Model): … … 14 16 def __init__(self, **kwargs): 15 17 super(BaseItem, self).__init__() 18 self.ViewPermission = ViewBase 19 self.AddPermission = AddBase 20 self.EditPermission = EditBase 16 21 self.__dict__.update(kwargs) 17 22 18 class Index(grok.Viewlet): 19 grok.viewletmanager(vw.MainArea) 20 #grok.context(IBaseItem) 21 #grok.order(1) 22 #grok.View(Index) # warum gibt das hier einen Fehler? 23 ## Forms 24 25 class DisplayForm(grok.DisplayForm): 26 #template = grok.PageTemplate(filename=os.path.join('baseitem_templates', 'content.pt')) 23 27 grok.template('content') 24 28 29 def __init__(self, context, request): 30 super(DisplayForm, self).__init__(context, request) 31 self.form_fields = grok.AutoFields(self.context.__class__) 32 33 # Wird wahrscheinlich nie benutzt - was sollte man einem Item hinzufügen? 25 34 class AddForm(grok.AddForm): 26 35 template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt')) 36 27 37 28 38 def __init__(self, context, request): 29 39 super(AddForm, self).__init__(context, request) 30 self.form_fields = grok.AutoFields(self.context-__class__) #.childClass) 40 self.form_fields = grok.AutoFields(self.context.__class__) 41 #grok.require(context.__class__.AddPermission) 31 42 32 43 @grok.action('Add item') … … 34 45 obj = self.context.__class__(**data) #.childClass(**data) 35 46 id = data['id'].lower() 47 print "Add to item %s, ID %s, Obj %s" % (self.context, id, obj) 36 48 self.context[id] = obj 37 49 self.redirect(self.url('@@index')) … … 39 51 class EditForm(grok.EditForm): 40 52 template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt')) 53 41 54 42 55 def __init__(self, context, request): 43 56 super(EditForm, self).__init__(context, request) 44 57 self.form_fields = grok.AutoFields(self.context.__class__) 45 46 def handle_edit_action(self, **data): 47 grok.EditForm.handle_edit_action(self, **data) 48 self.redirect(self.url('@@index')) 58 #grok.require(context.__class__.EditPermission) 59 60 # def handle_edit_action(self, **data): 61 # grok.EditForm.handle_edit_action(self, **data) 62 63 # @grok.action(u"Edit item") 64 # def edit(self, **data): 65 # id = data['id'].lower() 66 # obj = self.context[id] 67 # self.applyData(obj, **data) 68 # self.redirect(self.url('@@index')) # FIXME: funktioniert nicht!? 69 70 ## Viewlets 71 72 class DisplayViewlet(grok.Viewlet): 73 grok.viewletmanager(vw.MainArea) 74 grok.context(IBaseItem) 75 grok.view(vw.Index) 76 #grok.order(1) 77 #grok.template('content') 78 79 #def __init__(self, context, request, *other): 80 # super(Index, self).__init__(context, request, *other) 81 # grok.require(self.context.__class__.ViewPermission) 82 83 def update(self): 84 self.form = getMultiAdapter((self.context, self.request), 85 name='displayform') 86 self.form.update_form() 87 88 def render(self): 89 return self.form.render() 90 49 91 50 92 class AddViewlet(grok.Viewlet): -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/baseitem_templates/content.pt
-
Property
svn:keywords
set to
Id
r3562 r3737 1 <!-- $Id$ --> 2 <div class="breadcrumbs"> 3 <a href="" tal:attributes="href python:view.url(context.__parent__)"> 4 <span tal:condition="exists:context/__parent__/title" tal:content="context/__parent__/title">Part of</span> 5 <span tal:condition="exists:context/__parent__/name" tal:content="context/__parent__/name">Parent</span> 6 </a> 7 </div> 8 <h2><span tal:condition="exists:context/title" tal:content="context/title">Part of</span> <span tal:content="context/name">Objects</span></h2> 1 9 <div class="menubar"> 2 10 <ul> 3 11 <li><a href="" tal:attributes="href python:view.url(context.__parent__)">Up</a></li> 4 12 <li><a href="" tal:attributes="href python:view.url(context, '@@edit')">Edit</a></li> 5 < li><a href="" tal:attributes="href python:view.url(context, '@@add')">Add</a></li>13 <!-- <li><a href="" tal:attributes="href python:view.url(context, '@@add')">Add</a></li> --> 6 14 </ul> 7 15 </div> 8 <h2>Object <span tal:replace="context/name">Name</span></h2> 16 17 <div class="form-fields"> 18 <tal:block repeat="widget view/widgets"> 19 <div class="form-line"> 20 <span class="label" tal:content="widget/label">label</span>: 21 <span class="field" tal:content="structure widget">value</span> 22 </div> 23 </tal:block> 24 </div> 25 26 <div class="form-fields introspection"> 27 <tal:block repeat="item python:context.__dict__.keys()"> 28 <div class="form-line"> 29 <span class="label" tal:content="item">Key</span>: 30 <span class="field" tal:content="python:context.__dict__[item]">Value</span> 31 </div> 32 </tal:block> 33 </div> -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/baseitem_templates/edit_form.pt
-
Property
svn:keywords
set to
Id
r3557 r3737 1 <!-- $Id$ --> 2 <!-- Achtung, wird nicht benutzt! Statt dessen "basecontainer_templates/edit_form.pt"! --> 1 3 <form action="." tal:attributes="action request/URL" method="post" 2 4 class="edit-form" enctype="multipart/form-data"> -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/browser.txt
-
Property
svn:keywords
set to
Id
r3523 r3737 1 .. $Id$ 2 1 3 The waeup package 2 4 ******************** -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/catalog.py
-
Property
svn:keywords
set to
Id
r3571 r3737 1 # $Id$ 1 2 import grok, grok.index 2 3 from hurry.query.query import Query, Text -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/catalog_templates/studentsearch.pt
-
Property
svn:keywords
set to
Id
r3571 r3737 1 <!-- $Id$ --> 1 2 <div class="portlet"> 2 3 <form> -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/docs/faq-staff-de.rst
r3558 r3737 1 .. $Id$ 1 2 ============= 2 3 FAQ (deutsch) -
waeup/branches/hraban/src/waeup/docs/uli-on-interfaces.txt
-
Property
svn:keywords
set to
Id
-
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/hostel/__init__.py
-
Property
svn:keywords
set to
Id
r3566 r3737 1 # $Id$ 1 2 from interfaces import IHostel 2 3 from hostelcontainer import HostelContainer -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/hostel/hostel.py
-
Property
svn:keywords
set to
Id
r3571 r3737 1 # $Id$ 1 2 import grok 2 3 import waeup.baseitem as base 3 4 from waeup.hostel.interfaces import IHostel 4 5 from waeup.hostel.permissions import * 5 6 6 7 class Hostel(base.BaseItem): … … 9 10 grok.implements(IHostel) 10 11 name = u'Hostel' 12 ViewPermission = ViewHostel 13 AddPermission = AddHostel 14 EditPermission = EditHostel -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/hostel/hostelcontainer.py
-
Property
svn:keywords
set to
Id
r3571 r3737 1 # $Id$ 1 2 import grok 2 3 from waeup.hostel.interfaces import IHostelContainer -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/hostel/interfaces.py
-
Property
svn:keywords
set to
Id
r3571 r3737 1 ## 2 ## interfaces.py 1 # $Id$ 3 2 import grok 4 3 import re -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/interfaces.py
-
Property
svn:keywords
set to
Id
r3566 r3737 1 ##2 1 ## interfaces.py 2 # $Id$ 3 3 import grok 4 4 import re … … 41 41 ) 42 42 43 44 43 class IUniversity(grok.interfaces.IContainer): 45 44 """Representation of a university. -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/permissions.py
-
Property
svn:keywords
set to
Id
r3521 r3737 1 # $Id$ 1 2 import grok 2 3 3 class FacultyRead(grok.Permission):4 grok.name('waeup.facultyread')5 4 5 class ViewBase(grok.Permission): 6 grok.name('waeup.ViewBase') 7 grok.title('View Base') 8 9 class EditBase(grok.Permission): 10 grok.name('waeup.EditBase') 11 grok.title('Edit Base') 12 13 class AddBase(grok.Permission): 14 grok.name('waeup.AddBase') 15 grok.title('Add Base') 16 17 18 class ViewUniversity(grok.Permission): 19 grok.name('waeup.ViewUniversity') 20 grok.title('View University') 21 22 class EditUniversity(grok.Permission): 23 grok.name('waeup.EditUniversity') 24 grok.title('Edit University') 25 26 class AddUniversity(grok.Permission): 27 grok.name('waeup.AddUniversity') 28 grok.title('Add University') -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/static/app.css
-
Property
svn:keywords
set to
Id
r3562 r3737 1 /* $Id */ 2 1 3 html { 2 4 font-family: JansonText, Georgia, Times; … … 35 37 36 38 #logo img { 37 align: left;39 text-align: left; 38 40 float: left; 39 41 padding-right: 2em; … … 129 131 border: 1px solid #feb; 130 132 padding: 1em; 133 margin-bottom: 1em; 131 134 } 132 135 … … 134 137 min-height: 1em; 135 138 clear: both; 139 padding: 0.125em 0 0.125em 0; 136 140 } 137 141 138 142 .form-fields .label { 139 width: 20em; 143 display: inline-block; 144 width: 10em; 140 145 padding-right: 1em; 146 vertical-align: top; 141 147 } 142 148 … … 147 153 148 154 .form-fields .field { 149 150 155 } 151 156 … … 154 159 width: 30em; 155 160 } 161 162 dl { 163 clear: both; 164 } 165 166 dl dt { 167 min-width: 10em; 168 float: left; 169 clear: left; 170 font-weight: bold; 171 } 172 173 dl dd { 174 float: left; 175 } 176 177 .introspection > * { 178 display:none; 179 } 180 181 .introspection:hover > * { 182 display: block; 183 } -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/students/__init__.py
-
Property
svn:keywords
set to
Id
r3526 r3737 1 # $Id$ -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/students/interfaces.py
-
Property
svn:keywords
set to
Id
r3571 r3737 1 ## 2 ## interfaces.py 1 # $Id$ 3 2 import grok 4 3 import re … … 10 9 pass 11 10 12 class IStudent(I nterface):11 class IStudent(IBaseItem): 13 12 """Representation of a student. 14 13 """ … … 18 17 required = True, 19 18 constraint=(re.compile("^([A-Z]\d{6})?$").match) 19 ) 20 name = schema.TextLine( 21 title = u'Name of student', 22 default = u'Nobody', 23 required = True, 20 24 ) 21 25 entry_mode = schema.ASCIILine( # Choice? … … 32 36 max=600 33 37 ) 34 name = schema.TextLine(35 title = u'Name of student',36 default = u'Nobody',37 required = True,38 )39 38 jamb_reg_no = schema.ASCIILine( 40 title = u'JAMB Reg. No.', 39 title = u'JAMB Reg. No.', # wie ZVS 41 40 default = '', 42 41 required = False, -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/students/student.py
-
Property
svn:keywords
set to
Id
r3571 r3737 1 # $Id$ 1 2 import grok 2 3 import waeup.baseitem as base 3 4 from interfaces import IStudent 5 from waeup.students.permissions import * 4 6 5 7 def fromCsv(a): … … 20 22 grok.implements(IStudent) 21 23 name = u'Student' 22 23 fields = [ "entry_mode", 24 "end_level", 25 "name", 26 "jamb_reg_no", 27 "level", 28 "id", 29 "lga", 30 "entry_session", 31 "matric_no", 32 "sex", 33 "phone", 34 "session", 35 "course", 36 "mode", 37 "faculty", 38 "department", 39 "verdict", 40 "review_state", 41 "perm_address", 42 "email" 43 ] 44 45 46 def getCsv(self): 47 #return self.entry_mode, self.end_level, self.name, self.jamb_reg_no, self.level, self.id, self.lga, self.entry_session, self.matric_no, self.sex, self.phone, self.session, self.course, self.mode, self.faculty, self.department, self.verdict, self.review_state, self.perm_address, self.email 48 return [getattr(self, field, u"") for field in self.fields] 24 ViewPermission = ViewStudent 25 AddPermission = AddStudent 26 EditPermission = EditStudent 27 # 28 # fields = [ "entry_mode", 29 # "end_level", 30 # "name", 31 # "jamb_reg_no", 32 # "level", 33 # "id", 34 # "lga", 35 # "entry_session", 36 # "matric_no", 37 # "sex", 38 # "phone", 39 # "session", 40 # "course", 41 # "mode", 42 # "faculty", 43 # "department", 44 # "verdict", 45 # "review_state", 46 # "perm_address", 47 # "email" 48 # ] 49 # 50 # 51 # def getCsv(self): 52 # #return self.entry_mode, self.end_level, self.name, self.jamb_reg_no, self.level, self.id, self.lga, self.entry_session, self.matric_no, self.sex, self.phone, self.session, self.course, self.mode, self.faculty, self.department, self.verdict, self.review_state, self.perm_address, self.email 53 # return [getattr(self, field, u"") for field in self.fields] 49 54 50 55 51 56 #class AddViewlet(base.AddViewlet): 52 57 # grok.context(IStudent) 58 # grok.require(waeup.students.AddStudent) 53 59 # 54 #class Edit EditViewlet(base.EditViewlet):60 #class EditViewlet(base.EditViewlet): 55 61 # grok.context(IStudent) 62 # grok.require(waeup.students.EditStudent) -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/students/student.txt
-
Property
svn:keywords
set to
Id
r3526 r3737 1 waeup_ng.student 1 .. $Id$ 2 3 waeup.students 2 4 **************** 3 5 … … 6 8 We can create students:: 7 9 8 >>> from waeup _ng.studentimport Student10 >>> from waeup.students import Student 9 11 >>> s = Student(name='Foo Bar') 10 12 >>> s … … 14 16 15 17 >>> s.name 16 ' Mr.Nobody'18 'Nobody' 17 19 -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/students/studentcontainer.py
-
Property
svn:keywords
set to
Id
r3571 r3737 1 # $Id$ 1 2 import grok 2 3 import os -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/testing.py
-
Property
svn:keywords
set to
Id
-
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/tests/__init__.py
-
Property
svn:keywords
set to
Id
-
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/tests/namelist.txt
-
Property
svn:keywords
set to
Id
-
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/tests/test_waeup.py
-
Property
svn:keywords
set to
Id
-
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/tests/util.py
-
Property
svn:keywords
set to
Id
-
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/university/__init__.py
-
Property
svn:keywords
set to
Id
r3566 r3737 1 from interfaces import IFaculty, IDepartment 2 from facultycontainer import FacultyContainer 3 from faculty import Faculty 4 from department import Department 1 # $Id$ 2 #from interfaces import * 3 #from course import Course 4 #from department import Department 5 #from faculty import Faculty 6 #from permissions import * -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/university/certificate.py
-
Property
svn:keywords
set to
Id
r3526 r3737 1 # $Id$ -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/university/course.py
-
Property
svn:keywords
set to
Id
r3571 r3737 1 # $Id$ 1 2 import grok 2 3 import waeup.baseitem as base 4 from waeup.university import permissions 3 5 from waeup.university.interfaces import ICourse 4 6 5 class Course(grok.Model): 7 class Course(base.BaseItem): 8 """ 9 This is a Course (part of Department) 10 """ 6 11 grok.implements(ICourse) 7 12 name = u'Course' 13 plural_name = u'Courses' 14 ViewPermission = permissions.ViewCourse 15 AddPermission = permissions.AddCourse 16 EditPermission = permissions.EditCourse -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/university/department.py
-
Property
svn:keywords
set to
Id
r3571 r3737 1 # -*- coding: utf-8 -*- 2 # $Id$ 1 3 import grok 2 4 import waeup.basecontainer as base 5 from waeup.university import permissions 3 6 from waeup.university.interfaces import IDepartment 4 7 from waeup.university.course import Course 8 #from waeup.university.containers import CourseContainer 5 9 6 10 class Department(base.BaseContainer): 11 """ 12 This is a Department (part of Faculty, contains Courses) 13 """ 7 14 grok.implements(IDepartment) 8 15 childClass = Course 9 16 name = u'Department' 17 plural_name = u'Departments' 18 ViewPermission = permissions.ViewDepartment 19 AddPermission = permissions.AddDepartment 20 EditPermission = permissions.EditDepartment 10 21 11 #class Add(base.AddViewlet): 12 # grok.context(IDepartment) 22 def __init__(self, **kw): 23 super(Department, self).__init__(**kw) 24 self.__dict__.update(kw) 13 25 26 # Bei BaseContainer-Klassen müsen die beiden Viewlets ans Interface angepasst werden: 14 27 15 #class Edit(base.EditViewlet): 16 # grok.context(IDepartment) 28 class DisplayViewlet(base.DisplayViewlet): 29 grok.context(IDepartment) 30 31 class AddViewlet(base.AddViewlet): 32 grok.context(IDepartment) -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/university/faculty.py
-
Property
svn:keywords
set to
Id
r3566 r3737 1 # -*- coding: utf-8 -*- 2 # $Id$ 1 3 import grok 2 4 import waeup.basecontainer as base 5 from waeup.interfaces import IBaseContainer 6 from waeup.university import permissions 3 7 from waeup.university.interfaces import IFaculty 4 8 from waeup.university.department import Department … … 11 15 childClass = Department 12 16 name = u'Faculty' 17 plural_name = u'Faculties' 18 ViewPermission = permissions.ViewFaculty 19 AddPermission = permissions.AddFaculty 20 EditPermission = permissions.EditFaculty 13 21 14 #class Add(base.AddViewlet): 15 # grok.context(IFaculty) 16 17 #class Edit(base.Edit): 18 # grok.context(IFaculty) 22 def __init__(self, **kw): 23 super(Faculty, self).__init__(**kw) 24 self.__dict__.update(kw) 25 26 # Bei BaseContainer-Klassen müsen die beiden Viewlets ans Interface angepasst werden: 27 28 class DisplayViewlet(base.DisplayViewlet): 29 grok.context(IFaculty) 30 31 class AddViewlet(base.AddViewlet): 32 grok.context(IFaculty) -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/university/facultycontainer.py
-
Property
svn:keywords
set to
Id
r3571 r3737 1 # $Id$ 1 2 import grok 2 3 from waeup.basecontainer import BaseContainer 3 4 from waeup.interfaces import IBaseContainer 4 from waeup.university.interfaces import IFaculty5 5 from waeup.university.faculty import Faculty 6 6 -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/university/interfaces.py
-
Property
svn:keywords
set to
Id
r3571 r3737 1 # $Id$ 1 2 import grok 2 3 import re 3 4 from zope import schema 4 from waeup.interfaces import IBaseContainer 5 from waeup.interfaces import IBaseContainer, IBaseItem 5 6 6 7 class IFaculty(grok.interfaces.IContainer): … … 46 47 47 48 48 class ICourse(IBase Container):49 class ICourse(IBaseItem): 49 50 """Representation of a study course, provided by a department. 50 51 """ -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/utils/__init__.py
-
Property
svn:keywords
set to
Id
r3527 r3737 1 # $Id$ -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/utils/importexport.py
-
Property
svn:keywords
set to
Id
r3529 r3737 1 # $Id$ 1 2 import csv 2 3 -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/viewlets.py
-
Property
svn:keywords
set to
Id
r3566 r3737 1 1 # -*- coding: utf-8 -*- 2 # viewlets.py2 # $Id$ 3 3 import grok 4 4 from grok.interfaces import IContainer -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/viewlets_templates/appcss.pt
-
Property
svn:keywords
set to
Id
-
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/viewlets_templates/authuser.pt
-
Property
svn:keywords
set to
Id
-
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/viewlets_templates/copyright.pt
-
Property
svn:keywords
set to
Id
-
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/viewlets_templates/edit_form.pt
-
Property
svn:keywords
set to
Id
-
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/viewlets_templates/login.pt
-
Property
svn:keywords
set to
Id
-
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/viewlets_templates/logo.pt
-
Property
svn:keywords
set to
Id
-
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/viewlets_templates/master.pt
-
Property
svn:keywords
set to
Id
-
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/viewlets_templates/navigationbar.pt
-
Property
svn:keywords
set to
Id
r3562 r3737 1 1 <div id="adminbar" class="menubar" 2 2 tal:define="app view/getSite"> 3 <!-- <ul>4 <tal:block tal:repeat="menuitem view/menuitems">5 <li><a tal:attributes="href menuitem/url;title menuitem/title" tal:content="menuitem/text">Menuitem</a></li>6 </tal:block>7 </ul>-->8 3 <ul> 9 4 <li><a tal:attributes="href view/application_url">Home</a></li> 10 <li tal:repeat=" facapp/values">5 <li tal:repeat="item app/values"> 11 6 <a href="." 12 tal:content=" fac/name"13 tal:attributes="href python:view.url( fac)" />7 tal:content="item/name" 8 tal:attributes="href python:view.url(item)" /> 14 9 </li> 15 10 </ul> -
Property
svn:keywords
set to
-
waeup/branches/hraban/src/waeup/viewlets_templates/title.pt
-
Property
svn:keywords
set to
Id
-
Property
svn:keywords
set to
Note: See TracChangeset for help on using the changeset viewer.