*** alga has joined #schooltool | 01:01 | |
*** ColonelPanik has quit IRC | 03:15 | |
*** davidng has quit IRC | 03:31 | |
*** ColonelPanik has joined #schooltool | 03:41 | |
*** th1a has quit IRC | 06:15 | |
*** ColonelPanik has quit IRC | 06:18 | |
*** yvl has joined #schooltool | 12:40 | |
*** alga has quit IRC | 12:47 | |
*** mgedmin has joined #schooltool | 12:51 | |
*** menesis has joined #schooltool | 13:19 | |
*** Aiste has quit IRC | 14:27 | |
*** alga has joined #schooltool | 15:24 | |
*** alga has quit IRC | 15:29 | |
*** menesis has quit IRC | 16:17 | |
*** menesis has joined #schooltool | 16:17 | |
*** replaceafill has joined #schooltool | 16:19 | |
replaceafill | yvl, ping | 16:19 |
---|---|---|
yvl | pong, replaceafill | 16:20 |
replaceafill | hey yvl, you have 5 mins? | 16:20 |
replaceafill | or should i mail you? :) | 16:20 |
yvl | ask away :) | 16:21 |
replaceafill | ok, could you check the instructors.html view for sections | 16:21 |
replaceafill | from schooltool.course.browser.section import SectionInstructorView | 16:21 |
replaceafill | i want to filter the values to display only persons in the 'Teachers' group | 16:22 |
replaceafill | here's how i did it: http://pastebin.com/A27HS6up | 16:22 |
replaceafill | but it looks "funny" :/ | 16:23 |
replaceafill | i mean, using two methods: getAvailableItems and getOmmitedItems | 16:23 |
yvl | ouch | 16:23 |
yvl | you will be loading all persons in the list probably | 16:24 |
replaceafill | yes! | 16:24 |
replaceafill | although RelationshipViewBase works kind of the same | 16:25 |
yvl | by the way, does it really work? | 16:27 |
replaceafill | yes | 16:27 |
yvl | odd | 16:27 |
yvl | I'd expect it to show all persons | 16:27 |
yvl | but allow you to add only teachers | 16:27 |
replaceafill | i think getOmmitedItems is the one that filters people that is not a teacher from the display | 16:29 |
replaceafill | well, at least in the way i've used it :/ | 16:29 |
yvl | oh, wait | 16:29 |
yvl | yes | 16:29 |
yvl | I did not notice that you expanded that also | 16:29 |
replaceafill | self.available_table = self.createTableFormatter( | 16:29 |
replaceafill | ommit=self.getOmmitedItems(), | 16:29 |
replaceafill | prefix="add_item") | 16:29 |
replaceafill | that's from RelationshipViewBase | 16:30 |
yvl | well, you can always add the filter widget to the view | 16:31 |
yvl | like PersonFilterWidget | 16:31 |
yvl | just make it alwais filter what you want and display nothing | 16:31 |
replaceafill | ah | 16:31 |
yvl | or, rather, pass filter to the table formatter | 16:32 |
yvl | you will get the indexed items there | 16:33 |
yvl | filter widget may be easier to add | 16:33 |
yvl | otherwise you'll need to override .createTableFormatter of the view | 16:34 |
yvl | and pass your filtering function | 16:34 |
yvl | the function will get a list of items | 16:34 |
yvl | each item is a dict | 16:34 |
yvl | {'catalog': ..., 'id': ...} | 16:34 |
yvl | (at least for persons | 16:34 |
yvl | ) | 16:34 |
yvl | umm, it will be slow anyway | 16:37 |
yvl | (as you will iterate through all members of the teachers group) | 16:37 |
yvl | (because group relationships are not indexed) | 16:37 |
yvl | still, faster than iterating everything :) | 16:38 |
yvl | if I was a bit unclear: | 16:39 |
yvl | just query int ids of all persons in teachers group | 16:39 |
yvl | and filter items with matching 'id': ... | 16:39 |
replaceafill | something 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 |
replaceafill | that's from PersonFilterWidget | 16:41 |
yvl | yes | 16:43 |
replaceafill | ok, i'm going to try the FilterWidget approach :) | 16:44 |
replaceafill | thanks yvl | 16:45 |
yvl | you're welcome | 16:45 |
*** th1a has joined #schooltool | 17:22 | |
replaceafill | yvl, it worked :) http://pastebin.com/B3UgsPBy | 17:30 |
replaceafill | don't like the SEARCH_GROUP magic in __init__ though... | 17:31 |
yvl | umm | 17:32 |
yvl | wait, why did you need CambodiaPersonTableFormatter? | 17:32 |
yvl | if you are overwriting createTableFormatter | 17:33 |
replaceafill | it's a formatter i use for filtering by group and hiding the "groups" dropdown in the widget | 17:33 |
replaceafill | it's the one i used for the Students, Teachers and Administrators index views | 17:34 |
yvl | well, ok then | 17:34 |
yvl | but if you need *only* filtering, you can specify a different filter widget | 17:35 |
replaceafill | creating a new adapter? | 17:35 |
yvl | see SchoolToolTableFormatter.setup | 17:35 |
yvl | setUp | 17:35 |
yvl | self.filter_widget=queryMultiAdapter | 17:36 |
yvl | you can specify your FilterWidget for content/request pair | 17:36 |
replaceafill | but that will override all the filterwidgets for persons, right? | 17:36 |
replaceafill | i mean, in all views | 17:36 |
yvl | yes | 17:37 |
replaceafill | that's why i set it up manually :( | 17:37 |
replaceafill | i cannot say "do it only in this view" | 17:37 |
replaceafill | ala viewlet | 17:37 |
replaceafill | right? | 17:37 |
replaceafill | or am i missing something? (as usual) | 17:37 |
yvl | no, your'e completely right | 17:38 |
replaceafill | i mean, the filtering widget is used in several views, listings, instructors, members, ect | 17:38 |
yvl | ST has a mis-design there, in my opinion | 17:38 |
replaceafill | the logic in members will be different, i have to filter by 'students' and then by students without level... | 17:38 |
replaceafill | yes | 17:38 |
yvl | maybe you can use the filter parameter of the formatter.setUp? | 17:39 |
yvl | in CambodiaSectionInstructorView | 17:40 |
yvl | def filter(self, items): | 17:40 |
yvl | ... | 17:40 |
yvl | then | 17:40 |
yvl | in CambodiaSectionInstructorView.createTableFormatter() | 17:40 |
yvl | formatter.setUp(formatters=formatters, columns_before=columns_before, filter=self.filter, **kwargs) | 17:41 |
th1a | replaceafill: Looking over the irc logs from the past couple of days... | 17:42 |
yvl | if the filter is passed, it will override the filter_widget | 17:42 |
th1a | Just kill zonki please in the reports. | 17:42 |
replaceafill | th1a, ah ok, will do | 17:42 |
replaceafill | yvl, # if there is no filter widget, we just return all the items | 17:43 |
replaceafill | so, i override filter and "def filter" would have to do the intid lookup, etc | 17:44 |
yvl | oh, apologies, I got you confused there | 17:45 |
yvl | filter is not actually overridden | 17:45 |
replaceafill | it isnt? | 17:46 |
replaceafill | if not filter: | 17:46 |
replaceafill | filter = self.filter | 17:46 |
yvl | crap | 17:46 |
replaceafill | :| | 17:46 |
yvl | ok, I think it's time for me to go home :) | 17:47 |
replaceafill | go yvl | 17:47 |
yvl | because I'm starting to misread the code :) | 17:47 |
yvl | so yes | 17:47 |
yvl | if you pass the filter, it is used | 17:47 |
yvl | if you do not pass it, the widget's filter is used | 17:47 |
replaceafill | yes | 17:47 |
replaceafill | thanks again yvl | 17:48 |
replaceafill | th1a, i leave the "SchoolTool" text in the zonki part, correct? | 17:53 |
th1a | Just don't put anything there for now. | 17:54 |
th1a | Especially that pixelated text. | 17:54 |
replaceafill | :) we can change it for "real" text | 17:54 |
replaceafill | not "image text" | 17:54 |
th1a | You can make a nice small, gray, san-serif "Created with SchoolTool." | 17:55 |
th1a | in the least obtrusive way possible. | 17:55 |
replaceafill | :| | 17:55 |
th1a | It isn't really someplace we need to be doing a lot of branding. | 17:56 |
replaceafill | ah ok | 17:56 |
*** ColonelPanik has joined #schooltool | 18:35 | |
replaceafill | th1a, could i set up a demo CanDo instace for Glenda Lewis in our server? | 18:44 |
th1a | Do whatever you want with that server. | 18:44 |
replaceafill | :) | 18:44 |
th1a | (related to work) ;-) | 18:44 |
replaceafill | ah!!! | 18:45 |
replaceafill | :( | 18:45 |
replaceafill | i think that would make easier to fix bugs she may find | 18:45 |
th1a | replaceafill: Not Related to Work == Serving Porn, Running Spam Zombies, etc. | 18:50 |
replaceafill | :D | 18:50 |
th1a | Just to be clear... | 18:50 |
*** menesis has quit IRC | 19:47 | |
*** mgedmin has quit IRC | 20:58 | |
th1a | hey aelkner. | 21:19 |
*** menesis has joined #schooltool | 21:27 | |
replaceafill | menesis, i talked to the sysadmin in charge of the cando instance with the pdf problem | 21:36 |
replaceafill | he says he thinks it's an apache configuration problem | 21:36 |
replaceafill | because they access the report in two ways | 21:36 |
replaceafill | under one url the report works, under the other it doesnt!! | 21:37 |
menesis | replaceafill: oh well.. can we get examples to add as test case and fix if there is a problem in the code? | 22:04 |
menesis | actually, any apache config would be helpful since we don't have any examples in the book | 22:04 |
menesis | and so, the cando admins know better about running schooltool than me | 22:04 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!