aelkner | fsufitch, you there? | 01:12 |
---|---|---|
*** alga_ has joined #schooltool | 01:29 | |
*** alga has quit IRC | 01:30 | |
*** alga_ has quit IRC | 01:46 | |
*** alga has joined #schooltool | 01:47 | |
*** alga has quit IRC | 04:51 | |
aelkner | ybl: ping | 08:30 |
aelkner | yvl, i mean | 08:31 |
yvl | hi aelkner | 10:43 |
yvl | sorry, I'm late today, had to take my car to the shop | 10:45 |
*** menesis has joined #schooltool | 11:15 | |
*** fsufitch has quit IRC | 11:23 | |
*** alga has joined #schooltool | 12:34 | |
*** alga has quit IRC | 12:53 | |
*** alga has joined #schooltool | 14:07 | |
*** menesis has quit IRC | 15:05 | |
*** replaceafill has joined #schooltool | 15:06 | |
*** menesis has joined #schooltool | 16:02 | |
*** menesis has quit IRC | 16:14 | |
*** menesis has joined #schooltool | 16:14 | |
*** menesis has joined #schooltool | 16:16 | |
*** th1a has joined #schooltool | 16:30 | |
th1a | hi aelkner, replaceafill, yvl, menesis. | 16:31 |
replaceafill | good morning/afternoon | 16:31 |
menesis | hi | 16:31 |
aelkner | morning | 16:31 |
th1a | Well, the good news is aelkner doesn't have to worry about missing the Eagles in the Super Bowl while we're in Portugal. | 16:31 |
replaceafill | :D | 16:31 |
aelkner | yeah, i think :) | 16:31 |
yvl | morning guys :) | 16:32 |
* th1a never considered it a serious likelihood. | 16:32 | |
aelkner | now we'll see about them steelers | 16:32 |
th1a | I'm not counting on it. | 16:32 |
* replaceafill feels bad for indianapolis :( | 16:32 | |
aelkner | i was glad | 16:32 |
* replaceafill wanted indianapolis vs new england | 16:32 | |
aelkner | peyton was always over-rated | 16:33 |
aelkner | another one and out for him | 16:33 |
aelkner | how can you be great and have a 9-10 losing record in the playoffs | 16:33 |
aelkner | it's time to stop comparing him to the montana's of football history | 16:34 |
th1a | All right, moving on from football talk... | 16:34 |
th1a | How's your work coming aelkner? | 16:35 |
aelkner | well, i made some progress with the demographic field limit_keys field | 16:35 |
aelkner | i pushed my latest fix to make the field a set rather than a list | 16:36 |
aelkner | and that cuased the defaul widget to come up with a nive select (not drop-down) box | 16:36 |
aelkner | which makes a lot more sense than a list anyway, since there's only reason to choose any type once | 16:36 |
aelkner | so yvl, thanks for your tips in your email response | 16:37 |
th1a | is "nive select" a typo or something I should know about? | 16:37 |
aelkner | now, i have two remaining issues with it that i hope to work with yvl on after the meeting | 16:37 |
aelkner | nice select | 16:38 |
th1a | ok ;-) | 16:38 |
yvl | the one with two arrows? | 16:38 |
yvl | and two lists? | 16:38 |
aelkner | i don't know why i'm having trouble typing v and b lately | 16:38 |
aelkner | no better | 16:38 |
yvl | or the one with multi-select | 16:38 |
aelkner | what do you call the select box that has all the choices in one vertical box | 16:38 |
aelkner | and then you can click on one or more of them? | 16:38 |
aelkner | yes | 16:38 |
yvl | ah, that one has a small quirk though | 16:39 |
aelkner | it's exactly what we need | 16:39 |
yvl | try unselecting ;) | 16:39 |
replaceafill | yvl, so, z3c.form uses multiselect for sets and two lists for lists? | 16:39 |
aelkner | it works if you hold the control key down | 16:39 |
yvl | ah :) | 16:39 |
aelkner | yvl, could you please bull my branch during the meeting? | 16:39 |
yvl | I'll bull it ;) | 16:40 |
aelkner | thanks | 16:40 |
yvl | replaceafill, almost - | 16:40 |
yvl | zope has something like IUnorderedCollection | 16:40 |
yvl | that is used for sets and frozensets | 16:40 |
aelkner | replaceafill, you could pull it, too, i think your input would be helpful | 16:40 |
replaceafill | aelkner, i just have one comment about your values | 16:40 |
replaceafill | they are i18n strings | 16:40 |
aelkner | yeah, i was getting to that | 16:41 |
yvl | and there's some basic implementation of "multiple select" composed of checkboxes, though not wired in by default | 16:41 |
aelkner | it would better if what the user saw was a trnaslated vocabulary | 16:41 |
replaceafill | yvl, ah | 16:41 |
aelkner | i like the multi-select field yself | 16:41 |
aelkner | less for the user to click | 16:41 |
replaceafill | aelkner, value + title + token in vocabularies is better, i think | 16:41 |
yvl | yes | 16:42 |
replaceafill | the user sees the title, the form handles the token and you store the value | 16:42 |
aelkner | anyway | 16:42 |
aelkner | can we discuss this after the meeting? | 16:42 |
aelkner | i don't want to take up too much time here | 16:42 |
yvl | sure | 16:42 |
aelkner | also, i worked with filip, thanks replaceafill for your help there | 16:42 |
replaceafill | np | 16:42 |
aelkner | also, i had a good meeting with him this weekend on the phone | 16:43 |
aelkner | he has a very clear idea of how to proceed for now | 16:43 |
aelkner | also, i recommended that he meet with David soon to get the same tour i got | 16:43 |
aelkner | of the apps that David's brother made and what the user (David) expects | 16:44 |
aelkner | so he should be doing that very soon | 16:44 |
aelkner | finally, i looked at that South African report | 16:44 |
th1a | Yeah, it obviously helps a lot if you can look at the app David already has. | 16:44 |
aelkner | and we will need to talk about school demos at some point | 16:44 |
th1a | About getting them in trunk? | 16:45 |
aelkner | there are none | 16:45 |
aelkner | in schooltool.niepa i just extended IApplicationPreferences | 16:45 |
aelkner | as was done in schooltool.cambodia | 16:45 |
aelkner | but that is not as flexible as schol demos | 16:45 |
aelkner | we would need to add that like i did with adding resource demos | 16:46 |
th1a | OK. | 16:46 |
aelkner | anyway, i only lost a couple of days to that nasty cold | 16:46 |
aelkner | and we need to talk about my driving up this week | 16:46 |
aelkner | could it wait unil wed? | 16:47 |
aelkner | i have two things to do here tues | 16:47 |
th1a | That would be fine. | 16:47 |
aelkner | ok, we can talk later today | 16:47 |
aelkner | that's my report | 16:48 |
th1a | Thanks and condolences, aelkner. | 16:48 |
th1a | replaceafill? | 16:48 |
replaceafill | ok | 16:48 |
replaceafill | i split the functional tests of the gradebook | 16:49 |
replaceafill | and sent an email to the dev list so everybody is aware of it | 16:49 |
replaceafill | i also fixed the default category selection for new the activity form | 16:49 |
replaceafill | i have a question here | 16:50 |
replaceafill | how do you set the selected option in a z3c.form widget? | 16:50 |
replaceafill | i did this: | 16:50 |
replaceafill | def updateWidgets(self): | 16:50 |
replaceafill | super(ActivityAddView, self).updateWidgets() | 16:50 |
replaceafill | categories = getCategories(ISchoolToolApplication(None)) | 16:50 |
replaceafill | if not self.widgets['category'].value: | 16:50 |
replaceafill | self.widgets['category'].value = [categories.getDefaultKey()] | 16:50 |
replaceafill | sorry for the flood | 16:50 |
yvl | trying to remember... | 16:51 |
replaceafill | yvl, i don't like the 'if not', could i use the hidden input: | 16:51 |
replaceafill | <input name="form.widgets.category-empty-marker" | 16:51 |
replaceafill | type="hidden" value="1" /> | 16:51 |
replaceafill | in some way | 16:51 |
yvl | a sec, please go on with report ;) | 16:51 |
replaceafill | menesis merged those changes to trunk already | 16:52 |
replaceafill | thank menesis | 16:52 |
replaceafill | i also moved browser templates, rml and file resources to their own directories | 16:52 |
replaceafill | they looked like a mess in the browser directory | 16:52 |
replaceafill | and i added functional tests for: | 16:52 |
replaceafill | - the term and section dropdowns of the gradebook | 16:53 |
replaceafill | - the due date filter widget (and i have some comments about it) | 16:53 |
replaceafill | - averages higher than 100% | 16:53 |
replaceafill | (making sure they work with custom scoresystems) | 16:53 |
replaceafill | like we discussed last week | 16:54 |
yvl | replaceafill: adapter = zope.component.queryMultiAdapter( | 16:54 |
yvl | (self.context, self.request, self.form, self.field, self), | 16:54 |
yvl | interfaces.IValue, name='default') | 16:54 |
replaceafill | all this helped me found a bug: https://bugs.launchpad.net/bugs/700520 | 16:54 |
replaceafill | does default work for select dropdowns? | 16:54 |
yvl | (or alternatively, specify default=XXX in schema field) | 16:54 |
replaceafill | yvl, will try that then, i thought default didnt work for selects :( | 16:55 |
yvl | (it should, but I never tested) | 16:55 |
replaceafill | menesis, i noticed the gradebook's translation template was outdated | 16:55 |
replaceafill | but when i ran make update-translations to update them i got a traceback | 16:56 |
replaceafill | regarding zope.app.form vs zope.formlib | 16:56 |
yvl | (but if field.default is set, it takes precedence) | 16:56 |
replaceafill | yvl, ah! | 16:56 |
menesis | replaceafill, may be. I will update the template and translations myself | 16:56 |
replaceafill | menesis, http://pastebin.com/DhZ6F7Q3 that fixes it | 16:56 |
replaceafill | menesis, but i dont understand why those import dont work | 16:57 |
replaceafill | menesis, ok, i'lll leave that to you :) | 16:57 |
replaceafill | th1a, finally, i have some comments about the due date filter widget | 16:57 |
replaceafill | but i dont think that funciotnality is very important, correct? | 16:57 |
*** jelkner has joined #schooltool | 16:57 | |
replaceafill | i mean, it's a global setting | 16:58 |
replaceafill | that can be confusing for users | 16:58 |
replaceafill | if you enable it and then go to another worksheet, section or term, you will get the filtering | 16:58 |
menesis | Old imports should work, but updating them is desirable anyway | 16:58 |
replaceafill | menesis, cool | 16:58 |
replaceafill | yvl, in the gradebook i changed the use of date.today() to use IDateManager.today | 16:59 |
replaceafill | since it's easier to ftest | 16:59 |
yvl | thanks! | 16:59 |
th1a | replaceafill: Well, the due date filtering widget itself is kind of clunky. | 16:59 |
replaceafill | and there's a 'view.html' view that it's there but is not accessible for the user | 17:00 |
replaceafill | i mean, there's no button or link to it | 17:00 |
th1a | Basically the idea is that some teachers will want to put a lot of activities in one worksheet, so it makes that practical. | 17:00 |
replaceafill | th1a, also that widgets only works when you mark the checkbox, select the number of weeks and hit the 'Save' button! | 17:01 |
replaceafill | having to hit 'Save' seems weird | 17:01 |
replaceafill | maybe if we submit the form when the user marks the checkbox? | 17:02 |
th1a | That makes more sense. | 17:02 |
replaceafill | btw, the unaccessible 'view.html' view, looks like this: http://img808.imageshack.us/img808/7862/viewhtml.png | 17:02 |
th1a | Overall it should be less obtrusive. | 17:02 |
replaceafill | finally, i took a look at cambodia, have to clean it a little bit | 17:03 |
replaceafill | remove some hacks :( | 17:03 |
replaceafill | and i hope i get to finish the gradebook refactoring started by yvl | 17:03 |
replaceafill | and use it in cambodia | 17:03 |
replaceafill | since it makes easier to add columns to the gradebook | 17:03 |
replaceafill | th1a, that's it from me | 17:04 |
th1a | replaceafill: OK, sounds good. | 17:04 |
replaceafill | i plan to keep adding tests to the gradebook, if that's o | 17:04 |
replaceafill | ok | 17:04 |
th1a | Yes, especially since it is sensitive to small errors. | 17:04 |
th1a | yvl? | 17:05 |
yvl | pushed timetables forward, worht of 10 estimated hours | 17:05 |
yvl | * worth | 17:05 |
yvl | had to take some time of to fix my **** car | 17:06 |
yvl | spent some time discussing with menesis about upcoming release | 17:06 |
yvl | (and the next one :) ) | 17:06 |
yvl | and looked into blobs | 17:06 |
yvl | a short report on them: | 17:07 |
yvl | we can use them to store files on the filesystem | 17:07 |
yvl | and we should do that before bringing uploadable content like photos in | 17:07 |
yvl | they are not wired in in z3c.form, only formlib, so it will take some dev time | 17:07 |
yvl | and we should definitely use that to store big reports in the future | 17:08 |
yvl | blobs are quite transparent | 17:08 |
yvl | just store a big data chunk in a class attribute | 17:08 |
yvl | and later use links to the atribute, like '../persons/photo/inline' | 17:09 |
yvl | or '../persons/report/download' | 17:09 |
th1a | Would the .pdf's be directly readable from the file system? | 17:09 |
yvl | yes, but only Zope will find them | 17:09 |
yvl | they'll be (most likely) stored in 8 level folders | 17:10 |
yvl | A/F/1/4/2/C/3 ... | 17:10 |
yvl | and I noticed we can add our own naming, if necessary | 17:10 |
yvl | ZODB has some extendibility | 17:11 |
th1a | That's ok, it would just be silly if it was done in a way that they couldn't also be recovered in a disaster scenario. | 17:11 |
yvl | so we can have Reports/Student5/Foo.pdf if we really really need that | 17:11 |
replaceafill | yvl, wow nice feature :) | 17:11 |
replaceafill | (the naming thing) | 17:11 |
yvl | but we would need to write that! | 17:11 |
yvl | it's just a plugging point | 17:11 |
*** dadeng has joined #schooltool | 17:12 | |
yvl | in case of disaster... | 17:12 |
yvl | well, if the naming scheme is not changed, it will be very hard to fish data out | 17:13 |
yvl | in case the original database is lost | 17:13 |
th1a | It doesn't have to be easy, but possible is good. | 17:13 |
yvl | object ids go in the Data.fs, files on the file system | 17:13 |
th1a | It isn't a big deal. | 17:13 |
yvl | ok | 17:13 |
yvl | well, bascally that's it | 17:14 |
th1a | I was just checking to make sure this wasn't implemented in an implausibly stupid way. | 17:14 |
yvl | that's why I checked that last week :) | 17:14 |
th1a | Always good to check. ;-) | 17:14 |
th1a | yvl: Just stay focused on finishing timetables, please! | 17:14 |
yvl | wanted to know if there is integration with z3c.form, or if we need extra dependencies, etc... | 17:14 |
yvl | ok, th1a | 17:15 |
yvl | that's my report. | 17:15 |
th1a | Thanks yvl. | 17:16 |
th1a | menesis? | 17:16 |
menesis | as of today | 17:16 |
menesis | all zope packages we need are available in Natty! | 17:16 |
menesis | I have installed Natty over the weekend | 17:17 |
menesis | and they all install without errors | 17:17 |
menesis | Last week I uploaded the last 24 or so packages, so they went through quickly | 17:18 |
th1a | ! | 17:18 |
th1a | Yay! | 17:18 |
th1a | Great job menesis. | 17:18 |
menesis | to be exact, one package still needs work, that is zope.html | 17:19 |
menesis | it includes both fckeditor and ckeditor, but they are available in ubuntu | 17:19 |
menesis | so those packages should be used | 17:19 |
th1a | ah. | 17:19 |
menesis | I fiddled with that on Friday, but did not finish. | 17:20 |
menesis | will probably make a new zope.html release with updated versions | 17:21 |
menesis | also, I have updated ztk 1.0 versions to what I have packaged in Natty | 17:21 |
menesis | broke ztk buildbots, but fixed the next day | 17:22 |
menesis | ... | 17:23 |
menesis | what else | 17:23 |
menesis | tried to build schooltool docs using Sphinx | 17:23 |
menesis | that was quite easy, also uses the same style as book | 17:24 |
menesis | fixed some places where rendering was incorrect | 17:24 |
menesis | but spent only two hours on this | 17:25 |
th1a | Ah! | 17:25 |
th1a | Yes... I'd love to see those. | 17:25 |
menesis | I would like to make developer docs available because we *have* documentation but don't use it | 17:26 |
th1a | Please! | 17:26 |
replaceafill | please++ :D | 17:26 |
th1a | It can just be part of the book. | 17:26 |
menesis | it is developer documentation | 17:27 |
menesis | also is generated from different source | 17:27 |
menesis | would like to publish it at docs.schooltool.or | 17:28 |
menesis | but it is not my priority at the moment.. | 17:28 |
yvl | and buildbotted for ST 1.X, 1X+2, etc ;) | 17:28 |
menesis | just played with that to know is possible | 17:29 |
th1a | Well, just stick it somewhere on the web server where I can see it for now, please. | 17:30 |
th1a | Just jam it in a subdirectory. | 17:30 |
menesis | ok | 17:30 |
menesis | also last week merged replaceafill's branch, explained some bzr features, ... | 17:31 |
menesis | and that's all | 17:31 |
th1a | Thanks, menesis! | 17:31 |
th1a | OK, let's see... | 17:31 |
th1a | aelkner: I just noticed that it is supposed to snow hard Tuesday night through Wednesday. | 17:32 |
th1a | So I'd say we're looking at Friday at earliest for a visit. | 17:32 |
aelkner | ah | 17:32 |
aelkner | i don't have plan for the weekend if you think that would be better | 17:32 |
aelkner | obviously the steelers are playing | 17:32 |
th1a | No... weekends when you have two little kids are pretty much work time. ;-) | 17:32 |
aelkner | understood | 17:33 |
aelkner | next week? | 17:33 |
th1a | We'll see. | 17:33 |
th1a | The storm may be a dud. | 17:33 |
aelkner | bag of gravel? | 17:34 |
th1a | That's good for traction. | 17:34 |
aelkner | :) | 17:34 |
th1a | A couple more things... bonuses. | 17:34 |
th1a | menesis: I guess we should just say for you have everything up to SchoolTool itself ready for SchoolTool feature freeze in 3.5 weeks? | 17:35 |
th1a | Feb. 3. | 17:35 |
menesis | yes that's my goal | 17:35 |
th1a | OK, I'll send an email to that effect. | 17:35 |
th1a | replaceafill: If you could come up with a list of merge-related tasks for your bonus, that would be good. | 17:36 |
th1a | that is, things to prep from the local versions. | 17:36 |
replaceafill | th1a, ah ok | 17:36 |
th1a | also, replaceafill: I have a request to throw up a demo server for someone. I'll forward it to you. | 17:37 |
th1a | So if you could do that and perhaps kill any unused ones lying around. | 17:38 |
replaceafill | mark's demo? | 17:38 |
th1a | This would just be a stock SchoolTool. | 17:38 |
th1a | Yeah, you could take that down I'd imagine. | 17:38 |
replaceafill | ok i will | 17:38 |
replaceafill | aelkner, you have a niepa instance running in our VM, correct? | 17:39 |
aelkner | yeah, but nobody is using it | 17:39 |
replaceafill | and the zambia package is also running | 17:40 |
dadeng | who said so? | 17:40 |
aelkner | i haven't updated it either | 17:40 |
aelkner | dadeng, hey | 17:40 |
dadeng | aelkner | 17:40 |
aelkner | i thought you are using the sandbox on your local machine? | 17:40 |
th1a | replaceafill, I think you can take that down too. | 17:40 |
dadeng | ok, u mean the instance on vm? | 17:40 |
aelkner | th1a, take what down? | 17:40 |
dadeng | ok, i ignored that qualification | 17:40 |
aelkner | dadeng, yes | 17:40 |
th1a | aelkner, dadeng: Did your conversation jump here from another room? | 17:41 |
dadeng | but really we'll soon need it if it is available | 17:41 |
th1a | We're almost done anyhow. | 17:41 |
aelkner | no | 17:41 |
aelkner | dadeng just showed up now | 17:41 |
th1a | OK... as long as you guys are making sense to each other. ;-) | 17:41 |
dadeng | yes, i jumped in when u talked about niepa | 17:42 |
th1a | Oh, I see. | 17:42 |
th1a | Anyhow... | 17:42 |
th1a | So it is F-6. | 17:42 |
th1a | Six and a half weeks until Ubuntu feature freeze. | 17:42 |
th1a | Don't forget! | 17:42 |
dadeng | i'll allow aelkner to finish with the other conversation b4 i make my request | 17:42 |
th1a | Have a great week gentlemen! | 17:43 |
* th1a drops the bag of gravel. | 17:43 | |
replaceafill | thanks everybody | 17:43 |
th1a | hi dadeng. ;-) | 17:43 |
dadeng | hey th1a | 17:43 |
aelkner | yvl, replaceafill can we meet to discuss limit_keys after th1a and dadeng are done? | 17:43 |
th1a | oH, replaceafill -- I need your December invoice. | 17:43 |
yvl | ok, aelkner | 17:44 |
replaceafill | aelkner, sure | 17:44 |
replaceafill | th1a, i sent it to you last week | 17:45 |
replaceafill | or didnt i...? | 17:45 |
dadeng | th1a we're still working on capturing all small bugs in demo for niepa b4 i send email to u | 17:45 |
dadeng | on some requirements that came up at the last stakeholders' meeting | 17:45 |
replaceafill | th1a, Tuesday, January 4, 2011 | 17:45 |
th1a | replaceafill: I don't see it. | 17:45 |
th1a | OH. | 17:45 |
th1a | There it is. | 17:46 |
replaceafill | :D | 17:46 |
th1a | dadeng: Sounds good. | 17:46 |
dadeng | i also saw the UNICEF education specialist to discuss the draft budget for states | 17:47 |
dadeng | and he raised some issues | 17:47 |
dadeng | but i'll clarify that soon and get back to u | 17:47 |
dadeng | i'm yet to send the budget to state | 17:47 |
th1a | OK. | 17:48 |
dadeng | but it is all positive issues from project management point of view | 17:48 |
aelkner | yvl, replaceafill, so, limit_keys | 17:53 |
aelkner | when i added the Choice field for the value type of the List | 17:53 |
aelkner | it yielded that widget with the arrows | 17:53 |
aelkner | when i changed the list to be a Set, it creates the multi-select | 17:54 |
aelkner | two things: | 17:54 |
aelkner | first, i prefer the multi-select because it's simpler | 17:54 |
aelkner | second, in the case of limit_keys, the field really should be a set anyway | 17:55 |
aelkner | because a demo can be for students and teachers | 17:55 |
aelkner | but it needn't be able to have teachers twice, it doesn't mean anyting | 17:55 |
aelkner | so i think the multi-select is just what we need | 17:56 |
replaceafill | aelkner, you can tell the list widget to be 'unique' | 17:56 |
replaceafill | List(..., unique=True) | 17:56 |
yvl | :) | 17:56 |
aelkner | hmm | 17:56 |
yvl | well, a set makes sense there | 17:56 |
replaceafill | yvl, if a Set() is used for the field, the form will return a list object with the data, correct? | 17:56 |
aelkner | replaceafill, what's your feeling about the multi-select? | 17:56 |
yvl | (and the widget with the arrows is fidgety... it even pops javascript alerts!) | 17:56 |
aelkner | replaceafill, yes, that is what is happenng | 17:57 |
replaceafill | aelkner, i'd rather checkboxes :) | 17:57 |
yvl | well, if you use Set, it will create sets | 17:57 |
replaceafill | aelkner, also sets are not 'as easy' to update as list :P | 17:57 |
replaceafill | right yvl? | 17:58 |
replaceafill | i mean, 'easier' maybe is not the right word | 17:58 |
replaceafill | mylist.append(value) | 17:58 |
aelkner | so with the checkboxes, how do i get them to render? | 17:58 |
yvl | myset.add(value) ? | 17:58 |
replaceafill | yvl, yeah same thing :D | 17:58 |
replaceafill | i guess i'm just not used to sets... | 17:58 |
yvl | aelkner, you can set z3c.form.browser.checkbox.CheckboxFieldWidget as the custom widget | 17:59 |
yvl | (CheckBoxFieldWidget) | 17:59 |
aelkner | can it be used with a List? | 17:59 |
yvl | the answer is maybe | 18:00 |
replaceafill | i remember i've used checbox with lists | 18:00 |
yvl | the data converters should work | 18:01 |
yvl | but I can't vouch for it | 18:01 |
yvl | yep | 18:02 |
yvl | collectionType = self.field._type | 18:02 |
yvl | return collectionType(values) | 18:02 |
yvl | (from z3c/form/converter.py) | 18:02 |
yvl | (I like data converters... at least these days ;) ) | 18:04 |
aelkner | yvl, could you expain please? | 18:04 |
aelkner | explain | 18:04 |
* replaceafill wishes he understands them :( | 18:04 | |
yvl | well, you have fields and widgets | 18:05 |
yvl | widget values are one thing, field values - another | 18:05 |
yvl | (probably all) "sequence" widgets are implemented with vocabularies | 18:05 |
yvl | and there are separate converters, that can convert field (List, Set, ...) values to widget values | 18:06 |
yvl | for example - | 18:07 |
yvl | you have TextLinesConverter, defined in z3c/form/converters.py | 18:07 |
yvl | it adapts zope.schema.interfaces.ISequence and interfaces.ITextLinesWidget | 18:07 |
yvl | so if you have a field that inherits sequence... say a zope.schema.List | 18:08 |
yvl | and set the text lines widget to it | 18:08 |
yvl | it will use this particular converter | 18:08 |
yvl | (TextLinesConverter.toWidgetValue, and TextLinesConverter.toFieldValue | 18:09 |
yvl | toWidgetValue does this: u'\n'.join(unicode(v) for v in value) | 18:09 |
yvl | and there you go - a list converted to text :) | 18:09 |
yvl | toFieldValue does this eventually: collectionType(valueType(v) for v in value.splitlines()) | 18:10 |
yvl | which in this example is: | 18:10 |
yvl | list(valueType(v) for v in value.splitlines()) | 18:10 |
replaceafill | ah, that's the one used in the ethnicity demographics widget, correct? | 18:10 |
yvl | yes | 18:10 |
replaceafill | ah! | 18:10 |
replaceafill | and the '\n' in return u'\n'.join(unicode(v) for v in value) is what it breaks displays | 18:11 |
replaceafill | because the browser needs <br/> | 18:11 |
replaceafill | right | 18:11 |
aelkner | so... | 18:11 |
yvl | so, setting the checkbox widget should work with List :) | 18:12 |
aelkner | it did! | 18:12 |
aelkner | and checkoxes are way better than the multi-slect | 18:12 |
aelkner | i prefer using list since the class value is already that type | 18:13 |
aelkner | so getting back to the interface | 18:13 |
aelkner | right now i have the hard-coded list of choices where i need a vocabulary, right? | 18:14 |
yvl | yes | 18:14 |
aelkner | you mentioned that in your note, but i wasn't sure about the details of inserting the vocabulary | 18:14 |
aelkner | i need to create a class for the vocab? | 18:15 |
yvl | well, you have many choices there, sadly :) | 18:15 |
yvl | I preferred this one: | 18:15 |
yvl | register the vocabulary utility: | 18:16 |
yvl | <utility | 18:16 |
yvl | factory=".level.levelVocabularyFactory" | 18:16 |
yvl | provides="zope.schema.interfaces.IVocabularyFactory" | 18:16 |
yvl | name="schooltool.level.level.levelvocabulary" /> | 18:16 |
yvl | then use that name in your choice field | 18:16 |
*** dadeng has quit IRC | 18:16 | |
aelkner | yvl, i need to use a vocab utility from the level package? | 18:17 |
*** dadeng has joined #schooltool | 18:17 | |
replaceafill | aelkner, schooltool.app.utils | 18:17 |
yvl | no, you'll need to write a new one | 18:17 |
yvl | gimme time ;) | 18:17 |
replaceafill | TitledContainerItemVocabulary | 18:17 |
aelkner | sorry | 18:17 |
yvl | so, you'll need to specify source="schooltool.something.keys_to_limit_vocabulary" | 18:18 |
yvl | note - source, not vocabulary | 18:18 |
yvl | the util itself shoud look something like this: | 18:19 |
aelkner | instead of values_list, right? | 18:19 |
yvl | ... | 18:19 |
aelkner | i mean values= | 18:19 |
yvl | yes | 18:19 |
aelkner | ad i can use the level vocab as an example | 18:19 |
yvl | [wiring code...] | 18:20 |
replaceafill | man, yvl wires on the fly! | 18:20 |
aelkner | thing is yvl, if you could paste a diff now and again, we could see the magic your cooking up | 18:21 |
yvl | def LimitKeyVocabFactory(): | 18:21 |
yvl | def getKeyVocab(context): | 18:21 |
yvl | schooltool.app.utils.vocabulary([ | 18:21 |
yvl | ('teachers', _('Teachers'), | 18:21 |
yvl | ('also_teachers', _('Also Teachers'), | 18:21 |
yvl | ]) | 18:21 |
yvl | return getKeyVocab() | 18:21 |
yvl | I ment writing :D | 18:21 |
yvl | oh sorry | 18:22 |
yvl | it should read: | 18:22 |
yvl | return getKeyVocab | 18:22 |
yvl | [making a paste...] | 18:24 |
aelkner | thanks | 18:24 |
yvl | http://pastebin.com/xQrnhC18 | 18:26 |
yvl | I'd like to have something like this, | 18:27 |
replaceafill | yvl, what's the advantage of using the source def there instead of the vocabulary class | 18:28 |
yvl | we can change the utility and use any vocabulary we want in a customized app | 18:28 |
replaceafill | ah, indirection? | 18:28 |
yvl | b) we can easily change "def getKeyVocab(context)" part to IDemographicsKeysToLimit(context) | 18:29 |
yvl | and merge person and resource "demographics" fields to schooltool.additional_fields or something | 18:30 |
replaceafill | demo fields will be used to extend any object_ | 18:30 |
yvl | and then of course we can go wild, and register additional_fields for course ;) | 18:30 |
replaceafill | ah! | 18:30 |
*** dadeng has quit IRC | 18:31 | |
aelkner | yvl, thanks for that, now the second issue | 18:31 |
yvl | my pleasure :) | 18:31 |
aelkner | we need the vocabulary to be different in the case of resource demographic fields | 18:31 |
aelkner | the problem comes down to the views as well | 18:32 |
aelkner | IResourceDemogpahicFields exists | 18:32 |
aelkner | which is the derived from IDemogpahicFields but marks the other container | 18:32 |
aelkner | adding a field to that container, however, adds an IFieldDescription | 18:33 |
aelkner | so the vocab would contain students, etc | 18:33 |
aelkner | instead of location, etc, | 18:34 |
yvl | [annotating paste...] | 18:35 |
replaceafill | :| | 18:35 |
aelkner | when he's hot, he's hot :) | 18:35 |
aelkner | replaceafill, btw, [doing something...] seems to be yvl's convention, not a bad way of indicating it | 18:37 |
replaceafill | you mean like [talking to aelkner...]? | 18:38 |
replaceafill | :D | 18:38 |
aelkner | well, i wouldn't go that far :) | 18:38 |
yvl | there: http://pastebin.com/K5AvQwpC | 18:40 |
yvl | lots of adapters, yay :) | 18:41 |
replaceafill | nice! | 18:41 |
yvl | you know, it would be even better like this (updated) | 18:43 |
aelkner | cool, so the vocab itself figures out what the items are based on the adapted context | 18:43 |
yvl | yes | 18:44 |
yvl | well, the adapter figures out the vocabulary to use | 18:44 |
aelkner | that's what i meant :) | 18:45 |
yvl | :) | 18:45 |
aelkner | could you push your changes to your own demo_fields branch in you folder please? | 18:46 |
yvl | these are Notepad - coded :) | 18:46 |
aelkner | oh, never mind | 18:46 |
aelkner | i can work from them | 18:46 |
yvl | cool | 18:46 |
yvl | one more thing - if you want some sugar on top of it :) | 18:47 |
yvl | you could make the adapters to IFieldFilterVocabulary named adapters | 18:47 |
yvl | adapt (IDemographicsFields, IFieldDescription) and name == field_description.unique_name | 18:48 |
yvl | so that you could change a list for a single field :)) | 18:48 |
yvl | but that may be a bit over the top ;) | 18:49 |
aelkner | btw, why would it work to adapt the fields containers | 18:49 |
aelkner | when it is adding/editing the field itself that the vocab is needed? | 18:50 |
aelkner | sorry, never mind | 18:50 |
aelkner | i see it again in the code, just lost my train of thought | 18:50 |
aelkner | yeah, i'll table the named adapters idea since it's not strickly needed | 18:51 |
yvl | sure! | 18:51 |
aelkner | i'll respond to the email thread tonight if i have a problem | 18:52 |
aelkner | thanks again yvl | 18:53 |
yvl | my pleasure, aelkner :) | 18:53 |
replaceafill | nice work yvl | 18:53 |
yvl | well, happy coding! ;) | 18:54 |
aelkner | nice that we have someone who understands this stuff that well | 18:54 |
yvl | by coincidence, this is right in my job description ;D | 18:55 |
yvl | but seriously - always happy to help :) | 18:56 |
*** alga has quit IRC | 19:20 | |
*** menesis has quit IRC | 19:20 | |
*** jelkner has quit IRC | 19:43 | |
*** menesis has joined #schooltool | 20:18 | |
*** alga has joined #schooltool | 20:40 | |
replaceafill | th1a, is it a bug that we show two tabs for school years? one of them being really small... | 20:57 |
th1a | Different years? | 20:58 |
replaceafill | yes | 20:58 |
replaceafill | shouldn't we only show the active? | 20:58 |
replaceafill | wait | 20:59 |
replaceafill | this only happens for the manager! | 20:59 |
th1a | Yes. | 20:59 |
replaceafill | ah | 20:59 |
th1a | That was by design, although it is perhaps not the best design. | 20:59 |
replaceafill | even the small font? | 20:59 |
th1a | Well... yes... it seemed like a good idea at the time. | 21:00 |
replaceafill | :) | 21:00 |
replaceafill | ok, not a bug then ;) | 21:00 |
th1a | It is the kind of thing that leads to larger changes. | 21:01 |
*** replaceafill has quit IRC | 22:51 | |
*** replaceafill has joined #schooltool | 23:56 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!