*** menesis has quit IRC | 01:12 | |
*** hotwebmatter has quit IRC | 06:39 | |
*** menesis has joined #schooltool | 08:34 | |
*** yvl has joined #schooltool | 09:27 | |
*** replaceafill has joined #schooltool | 15:14 | |
replaceafill | yvl, you gone? | 17:25 |
---|---|---|
yvl | hey replaceafill | 17:25 |
replaceafill | hey yvl | 17:26 |
replaceafill | quick question | 17:26 |
replaceafill | i've figured out the new table + pdf functionality | 17:26 |
replaceafill | but i'm wondering | 17:26 |
replaceafill | i think there's still no way to customize visible columns? | 17:26 |
yvl | umm | 17:27 |
yvl | well, there is | 17:27 |
replaceafill | maybe i'm just missing it... | 17:28 |
yvl | see FlatRMLTable | 17:28 |
yvl | and visible_column_names | 17:28 |
replaceafill | ah | 17:28 |
replaceafill | i was looking at table.table and table.ajax | 17:28 |
replaceafill | so, if i have two versions of the view, one html and one pdf | 17:29 |
replaceafill | the pdf version will just work | 17:30 |
yvl | if using same visible columns | 17:30 |
yvl | if you want to change, you have several options there | 17:30 |
* yvl starts to remember ;) | 17:30 | |
yvl | you can provide an adapter: | 17:30 |
yvl | zope.component.queryMultiAdapter( | 17:30 |
yvl | (self.context, self.request, self.view, column), | 17:30 |
yvl | interfaces.IRMLColumn, | 17:30 |
yvl | column.name | 17:30 |
yvl | ) | 17:30 |
replaceafill | but i'd still need to override makeFormatter? | 17:30 |
replaceafill | i mean, for the html version | 17:31 |
yvl | well | 17:31 |
yvl | maybe :D | 17:31 |
replaceafill | or we can include visible_column_names in makeFormatter :) | 17:32 |
replaceafill | what i'm doing right now: | 17:32 |
yvl | so, here are 3 ways to override visibility: | 17:32 |
* replaceafill listens | 17:32 | |
yvl | 1) change the HTML table formatter's visible column | 17:32 |
yvl | 2) inherit from... RMLTable I think, and specify visible_column_names there (thus replacing the @property) | 17:33 |
replaceafill | visible_columns? | 17:33 |
yvl | yes | 17:33 |
replaceafill | ah! | 17:33 |
replaceafill | so, visible_columns in the table formatter does what the old visible_column_names used to do | 17:33 |
yvl | 3) make a class HiddenColumn(Column): | 17:33 |
yvl | visible = False | 17:34 |
yvl | and register it in ZCML | 17:34 |
yvl | for your context, request, view, column and specify name="the_column_name" | 17:34 |
replaceafill | oh, 3) seems fancy :) | 17:34 |
replaceafill | i was looking for visible_column_names, and missed visible_columns | 17:34 |
replaceafill | that's probably the way i want to go | 17:35 |
replaceafill | i'm converting all existing grouping tables to use the new classes | 17:35 |
replaceafill | getting rid of custom table_formatter's | 17:35 |
yvl | oh | 17:36 |
yvl | I just noticed a whoopsy | 17:36 |
yvl | in FlatRMLTable | 17:36 |
yvl | @property | 17:36 |
yvl | def visible_column_names | 17:36 |
yvl | returns columns, not their names | 17:36 |
yvl | and FlatRMLTable.getColumns does | 17:37 |
yvl | visible_names = [c.name for c in self.visible_column_names] | 17:37 |
replaceafill | ah | 17:37 |
yvl | that's a naming bug | 17:37 |
yvl | well, not naming, just bug | 17:37 |
yvl | if you could change it so that visible_column_names return | 17:37 |
yvl | return [c.name for c in self.formatter.visible_columns] | 17:37 |
yvl | and getColumns just do | 17:38 |
yvl | visible_names = list(self.visible_column_names) | 17:38 |
replaceafill | ah ok | 17:38 |
yvl | thanks! | 17:39 |
replaceafill | thanks yvl | 17:39 |
replaceafill | i can continue now :) | 17:39 |
replaceafill | nice work on the table formatters btw :) | 17:39 |
replaceafill | it's helping me get rid of lots of custom s**t | 17:39 |
yvl | thanks | 17:40 |
*** yvl has quit IRC | 18:12 | |
*** menesis has quit IRC | 18:40 | |
*** menesis has joined #schooltool | 18:44 | |
*** ignas has joined #schooltool | 18:53 | |
*** ignas has quit IRC | 21:11 | |
th1a | hi replaceafill. | 23:33 |
th1a | https://answers.launchpad.net/schooltool/+question/219771 | 23:33 |
replaceafill | hey th1a | 23:33 |
replaceafill | replying... | 23:34 |
replaceafill | th1a, answered | 23:43 |
th1a | Thanks. | 23:43 |
replaceafill | timeout error :| | 23:45 |
replaceafill | ah nv | 23:45 |
replaceafill | nm | 23:45 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!