Merge lp:~rick-rickspencer3/pytask/delete_tasks_from_couch into lp:pytask

Proposed by Rick Spencer
Status: Merged
Merged at revision: 70
Proposed branch: lp:~rick-rickspencer3/pytask/delete_tasks_from_couch
Merge into: lp:pytask
Diff against target: 28 lines (+9/-1)
1 file modified
bin/pytask (+9/-1)
To merge this branch: bzr merge lp:~rick-rickspencer3/pytask/delete_tasks_from_couch
Reviewer Review Type Date Requested Status
Ryan Macnish Pending
Review via email: mp+25401@code.launchpad.net

Commit message

changed remove_rows to look like this:
    def remove_row(self, widget, data=None):
        """Removes the currently selected row from the couchgrid"""
        #work around to actually delete records from desktopcouch
        #in maverick, using delete=true in remove_selected_rows will have
        #the same effect
        database = CouchDatabase("pytask")
        for r in self.grid.selected_rows:
            database.delete_record(r["__desktopcouch_id"])

        self.grid.remove_selected_rows()

Description of the change

Added a couple of lines to make the remove selected tasks buttons actually delete the tasks from desktopcouch, if you want to do it that way.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/pytask'
2--- bin/pytask 2010-05-16 10:57:01 +0000
3+++ bin/pytask 2010-05-16 17:35:43 +0000
4@@ -21,7 +21,7 @@
5 from quickly.widgets.couch_grid import CouchGrid
6 from quickly.widgets.grid_filter import GridFilter
7 from quickly.widgets.grid_column import IntegerColumn
8-
9+from desktopcouch.records.server import CouchDatabase
10 import gettext
11 from gettext import gettext as _
12 gettext.textdomain('pytask')
13@@ -129,7 +129,15 @@
14
15 def remove_row(self, widget, data=None):
16 """Removes the currently selected row from the couchgrid"""
17+ #work around to actually delete records from desktopcouch
18+ #in maverick, using delete=true in remove_selected_rows will have
19+ #the same effect
20+ database = CouchDatabase("pytask")
21+ for r in self.grid.selected_rows:
22+ database.delete_record(r["__desktopcouch_id"])
23+
24 self.grid.remove_selected_rows()
25+
26
27 def toolbar_toggle(self, widget, data=None):
28 if widget.active:

Subscribers

People subscribed via source and target branches