IRC log of #schooltool for Thursday, 2010-07-01

*** alga has joined #schooltool01:01
*** ColonelPanik has quit IRC03:15
*** davidng has quit IRC03:31
*** ColonelPanik has joined #schooltool03:41
*** th1a has quit IRC06:15
*** ColonelPanik has quit IRC06:18
*** yvl has joined #schooltool12:40
*** alga has quit IRC12:47
*** mgedmin has joined #schooltool12:51
*** menesis has joined #schooltool13:19
*** Aiste has quit IRC14:27
*** alga has joined #schooltool15:24
*** alga has quit IRC15:29
*** menesis has quit IRC16:17
*** menesis has joined #schooltool16:17
*** replaceafill has joined #schooltool16:19
replaceafillyvl, ping16:19
yvlpong, replaceafill16:20
replaceafillhey yvl, you have 5 mins?16:20
replaceafillor should i mail you? :)16:20
yvlask away :)16:21
replaceafillok, could you check the instructors.html view for sections16:21
replaceafillfrom schooltool.course.browser.section import SectionInstructorView16:21
replaceafilli want to filter the values to display only persons in the 'Teachers' group16:22
replaceafillhere's how i did it:
replaceafillbut it looks "funny" :/16:23
replaceafilli mean, using two methods: getAvailableItems and getOmmitedItems16:23
yvlyou will be loading all persons in the list probably16:24
replaceafillalthough  RelationshipViewBase works kind of the same16:25
yvlby the way, does it really work?16:27
yvlI'd expect it to show all persons16:27
yvlbut allow you to add only teachers16:27
replaceafilli think getOmmitedItems is the one that filters people that is not a teacher from the display16:29
replaceafillwell, at least in the way i've used it :/16:29
yvloh, wait16:29
yvlI did not notice that you expanded that also16:29
replaceafill        self.available_table = self.createTableFormatter(16:29
replaceafill            ommit=self.getOmmitedItems(),16:29
replaceafill            prefix="add_item")16:29
replaceafillthat's from RelationshipViewBase16:30
yvlwell, you can always add the filter widget to the view16:31
yvllike PersonFilterWidget16:31
yvljust make it alwais filter what you want and display nothing16:31
yvlor, rather, pass filter to the table formatter16:32
yvlyou will get the indexed items there16:33
yvlfilter widget may be easier to add16:33
yvlotherwise you'll need to override .createTableFormatter of the view16:34
yvland pass your filtering function16:34
yvlthe function will get a list of items16:34
yvleach item is a dict16:34
yvl{'catalog': ..., 'id': ...}16:34
yvl(at least for persons16:34
yvlumm, it will be slow anyway16:37
yvl(as you will iterate through all members of the teachers group)16:37
yvl(because group relationships are not indexed)16:37
yvlstill, faster than iterating everything :)16:38
yvlif I was a bit unclear:16:39
yvljust query int ids of all persons in teachers group16:39
yvland filter items with matching 'id': ...16:39
replaceafillsomething like this:16:41
replaceafill                int_ids = getUtility(IIntIds)16:41
replaceafill                keys = set([int_ids.queryId(person)16:41
replaceafill                            for person in group.members])16:41
replaceafillthat's from PersonFilterWidget16:41
replaceafillok, i'm going to try the FilterWidget approach :)16:44
replaceafillthanks yvl16:45
yvlyou're welcome16:45
*** th1a has joined #schooltool17:22
replaceafillyvl, it worked :)
replaceafilldon't like the SEARCH_GROUP magic in __init__ though...17:31
yvlwait, why did you need CambodiaPersonTableFormatter?17:32
yvlif you are overwriting createTableFormatter17:33
replaceafillit's a formatter i use for filtering by group and hiding the "groups" dropdown in the widget17:33
replaceafillit's the one i used for the Students, Teachers and Administrators index views17:34
yvlwell, ok then17:34
yvlbut if you need *only* filtering, you can specify a different filter widget17:35
replaceafillcreating a new adapter?17:35
yvlsee SchoolToolTableFormatter.setup17:35
yvlyou can specify your FilterWidget for content/request pair17:36
replaceafillbut that will override all the filterwidgets for persons, right?17:36
replaceafilli mean, in all views17:36
replaceafillthat's why i set it up manually :(17:37
replaceafilli cannot say "do it only in this view"17:37
replaceafillala viewlet17:37
replaceafillor am i missing something? (as usual)17:37
yvlno, your'e completely right17:38
replaceafilli mean, the filtering widget is used in several views, listings, instructors, members, ect17:38
yvlST has a mis-design there, in my opinion17:38
replaceafillthe logic in members will be different, i have to filter by 'students' and then by students without level...17:38
yvlmaybe you can use the filter parameter of the formatter.setUp?17:39
yvlin CambodiaSectionInstructorView17:40
yvldef filter(self, items):17:40
yvlin CambodiaSectionInstructorView.createTableFormatter()17:40
yvlformatter.setUp(formatters=formatters, columns_before=columns_before, filter=self.filter, **kwargs)17:41
th1areplaceafill:  Looking over the irc logs from the past couple of days...17:42
yvlif the filter is passed, it will override the filter_widget17:42
th1aJust kill zonki please in the reports.17:42
replaceafillth1a, ah ok, will do17:42
replaceafillyvl,  # if there is no filter widget, we just return all the items17:43
replaceafillso, i override filter and "def filter" would have to do the intid lookup, etc17:44
yvloh, apologies, I got you confused there17:45
yvlfilter is not actually overridden17:45
replaceafillit isnt?17:46
replaceafill        if not filter:17:46
replaceafill            filter = self.filter17:46
yvlok, I think it's time for me to go home :)17:47
replaceafillgo yvl17:47
yvlbecause I'm starting to misread the code :)17:47
yvlso yes17:47
yvlif you pass the filter, it is used17:47
yvlif you do not pass it, the widget's filter is used17:47
replaceafillthanks again yvl17:48
replaceafillth1a, i leave the "SchoolTool" text in the zonki part, correct?17:53
th1aJust don't put anything there for now.17:54
th1aEspecially that pixelated text.17:54
replaceafill:) we can change it for "real" text17:54
replaceafillnot "image text"17:54
th1aYou can make a nice small, gray, san-serif "Created with SchoolTool."17:55
th1ain the least obtrusive way possible.17:55
th1aIt isn't really someplace we need to be doing a lot of branding.17:56
replaceafillah ok17:56
*** ColonelPanik has joined #schooltool18:35
replaceafillth1a, could i set up a demo CanDo instace for Glenda Lewis in our server?18:44
th1aDo whatever you want with that server.18:44
th1a(related to work) ;-)18:44
replaceafilli think that would make easier to fix bugs she may find18:45
th1areplaceafill:  Not Related to Work == Serving Porn, Running Spam Zombies, etc.18:50
th1aJust to be clear...18:50
*** menesis has quit IRC19:47
*** mgedmin has quit IRC20:58
th1ahey aelkner.21:19
*** menesis has joined #schooltool21:27
replaceafillmenesis, i talked to the sysadmin in charge of the cando instance with the pdf problem21:36
replaceafillhe says he thinks it's an apache configuration problem21:36
replaceafillbecause they access the report in two ways21:36
replaceafillunder one url the report works, under the other it doesnt!!21:37
menesisreplaceafill: oh well.. can we get examples to add as test case and fix if there is a problem in the code?22:04
menesisactually, any apache config would be helpful since we don't have any examples in the book22:04
menesisand so, the cando admins know better about running schooltool than me22:04

Generated by 2.15.1 by Marius Gedminas - find it at!