IRC log of #schooltool for Saturday, 2011-04-30

fsufitchi get it00:00
fsufitchwoo! works00:01
fsufitchaelkner: ping00:01
aelknerfsufitch, yes?00:06
fsufitchdone with the test-only add view00:06
fsufitchwant me to commit/push?00:06
aelknercan you email the diff first?00:07
fsufitchok00:08
fsufitchsent00:09
aelknerlooking...00:09
aelknerok, here's something that i think you should change00:12
aelknerjustas made me stop using python: in page templates00:13
aelknerso the trick is, you create a view method that returns a dictionary00:13
aelknerso the tal:repeat"course view/courses"00:14
aelknertal:content="course/title"00:14
fsufitchah00:15
fsufitchokay00:15
aelknerso the view class method, courses does the loop though context00:15
fsufitchyou mean returns a list00:15
aelknerand returns a dictionary, easily used in the template00:15
aelknersorry00:15
aelknerlist of dictionaries00:15
aelknerso you see the design patern, right?00:16
fsufitcher...00:16
fsufitchno, i don't... do you have an example?00:16
aelknerlooking...00:17
fsufitcha list of dictionaries that contain the object infos?00:17
fsufitchso, [ {'title': 'mytitle1'}, {'title':'mytitle2'}, etc]?00:18
aelknerschooltool/intervention/browser/intervention.py00:18
aelknerclass SectionInterventionsView00:18
aelknermessageLinks, goalLinks, etc. return lists of dictonaries00:19
aelknerfsufitch, yes to your question00:19
fsufitchi see00:19
fsufitchi get it now00:19
aelknertemplates like to be driven by lists of dictioaries00:19
aelkneranyway, that's a good pattern to pick up00:20
fsufitchokay :)00:20
aelknerbtw, to save you time waiting on me, please email me the diff each time before pinging00:20
fsufitchok00:21
*** replaceafill has quit IRC00:27
*** menesis has quit IRC00:35
fsufitchaelkner: ping00:45
aelknerlooking...00:47
fsufitch:)00:48
aelknernice00:48
aelknerthat's a substantial looking diff, i'd commit and push00:49
fsufitchok00:49
aelknerso i'd say the next thing to do is adding to proposed_courses00:50
fsufitcha view to do that?00:51
aelknerthat will be a lot trickier, so you'll need to do some reasearch00:51
aelkneryes00:51
aelkneryou'll need a z3c.formlib view for that00:51
aelknerso, and example would be helpful00:51
aelknerlooking...00:52
fsufitchoh no, z3c.forms!00:52
aelkner:)00:54
aelknerok, for starters, check out schooltool/schoolyear/browser/schoolyear.py00:58
aelknerSchoolYearAddView and SchoolYearEditView both use a form adapter, which may not be necessary00:59
aelknerbut it might, so it won't hurt you to look at it00:59
aelknerthe idea with using the adapter is that the field.Fields statement needs to know what fields to render in the view01:00
aelknerand the interface for the context itself may have too many or too few fields01:00
fsufitchi see01:01
aelkneryou know what, i can't even figure out upon quick inspection what that adapter is doing in this case01:02
fsufitchso i define a form class, and make up its schema01:02
fsufitchhaha01:03
fsufitchit looks like it's just providing access to the SchoolYear's attributes in... an add form?01:03
fsufitchthat doesn't make much sense01:03
aelkneri agree01:04
aelkneri have a better example01:04
aelknerschooltool/gradebook/browser/report_card.py01:05
aelknerReportActivityAddView actually uses the interface of the context01:05
aelknera much simpler example01:05
aelknerand it even has special code for creating the object which gives you an example of that01:06
fsufitchcool01:07
aelknerit also uses the standard form macro for it's page template01:08
aelknerthat means you don't have to make any decisions about form html01:09
fsufitchyup01:09
fsufitchthanks!01:09
aelkneryour view is guaranteed to look like the rest of the schooltool forms which is important01:09
fsufitchyup01:09
aelknerwe will be doing a re-design of schooltool's look and feel, so that will come in handy01:09
*** replaceafill has joined #schooltool01:10
aelknerso you realize that some of your fields are going to be using dictionaries in the future01:10
aelkneri don't want you do worry about that for now, but i wanted you to see it coming01:10
aelknerfor now, freeform text is good enough01:11
fsufitchokay01:11
fsufitchmakes sense01:11
aelknerfields like division, cluster and pathway, for instance01:11
aelknerthose will be objects in themselves01:11
aelknerso after you have created views for those, we can think about making dictionaries01:12
aelknerfor providing drop-downs in the form that you are working on now01:12
fsufitchokay01:13
aelknerbut getting your first z3c form working in the short term will be satisfying01:13
fsufitch:)01:13
fsufitchbut, right now i have to go grab some dinner01:14
fsufitchmy stomach is currently digesting my programming focus instead of food01:14
aelknerso i think you have a good pattern with that example01:14
aelknerok, when will you be available again01:14
fsufitchhmm, in an hour, i'd say01:16
fsufitchso, i'll see you then, then01:18
aelknerok01:19
*** replaceafill has quit IRC01:26
*** fsufitch has quit IRC01:52
*** menesis has joined #schooltool02:06
*** menesis has quit IRC02:13
*** fsufitch has joined #schooltool02:21
fsufitchaelkner: oing, im back02:21
fsufitch*ping02:22
aelknerping, pong, the witch is dead02:22
fsufitch:)02:22
aelknerso, although you won't be able to commit anything by the time you are done02:22
aelkneri'd like to see your diff shortly before you decide to shut down so that i can give you some feedback02:23
fsufitchokay02:24
fsufitch:)02:24
aelkneri mean, basically, you cold create view the view classes, the template, and the registration02:25
aelknereven if they don't really work02:25
*** th1a has quit IRC04:30
*** fsufitch has quit IRC04:52
*** menesis has joined #schooltool09:48
*** menesis has quit IRC16:02
*** menesis has joined #schooltool16:03
*** aelkner has quit IRC18:26
*** aelkner has joined #schooltool18:37

Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!