Merge lp:~humitos/encuentro/filter-comboboxes into lp:encuentro
Proposed by
Manuel Kaufmann
Status: | Needs review | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~humitos/encuentro/filter-comboboxes | ||||
Merge into: | lp:encuentro | ||||
Diff against target: |
163 lines (+74/-12) 3 files modified
encuentro/data.py (+36/-9) encuentro/ui/central_panel.py (+4/-2) encuentro/ui/main.py (+34/-1) |
||||
To merge this branch: | bzr merge lp:~humitos/encuentro/filter-comboboxes | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Facundo Batista | Needs Fixing | ||
Review via email: mp+233211@code.launchpad.net |
Description of the change
This is the old branch filter-
To post a comment you must log in.
Unmerged revisions
- 229. By Manuel Kaufmann
-
ComboBoxes to filter by Channel and Section
The merge is conflicting in a trivial couple of lines.
After you fix that, please consider:
- Don't store channels or sections in the config: this is a problem for when they change (because of new data) where you'll need to merge, or discard elements, etc. It doesn't worth it. Just "calculate" the list of sections and channels when the data is loaded, at init time.
- Very related to the previous one: you need three structures: the curated list of channels, the curated list of sections, and a dict where for each channel you have the list of channels (and not build it in every change).
- This line...
channels = sorted( list(set( [e.channel for _, e in self.items()])))
...can be written like this...
channels = sorted( set(e.channel for e in self.values()))
...which is simpler, faster, and easier to read.
- You have a "import pdb" in the middle of the code!!
- Maybe it's better to add the "Todas las secciones" item in the same place you're converting the set to a list (a couple of lines above). BTW, sort that list...
- You're not using real data when building the filter_section combobox.
- On on_channel_changed you also should call set_filter(), with the selected channel, and None as the section.
If you have any doubt, let's discuss in IRC.
The rest is very nice, I think it's good improvement to the UI.
Thank you very much!!