comparison getan.py @ 25:155b23da504b

Bugfix and improvements in the process to move/delete entries.
author Ingo Weinzierl <ingo_weinzierl@web.de>
date Sun, 29 Aug 2010 19:56:11 +0200
parents 9c4e8ba3c4fa
children 5e4d2810a739
comparison
equal deleted inserted replaced
24:c89721a3f0f8 25:155b23da504b
55 entries = [] 55 entries = []
56 try: 56 try:
57 while True: 57 while True:
58 node = self.entries_view.selection.pop() 58 node = self.entries_view.selection.pop()
59 if node.selected: node.select() 59 if node.selected: node.select()
60 entries.append(node.entry) 60 entries.append(node.item)
61 logger.info("GetanController: move entry '%s' (id = %d, "\ 61 logger.info("GetanController: move entry '%s' (id = %d, "\
62 "project id = %d) to project '%s'" 62 "project id = %d) to project '%s'"
63 % (node.entry.desc, node.entry.id, 63 % (node.item.desc, node.item.id,
64 node.entry.project_id, project.desc)) 64 node.item.project_id, project.desc))
65 65
66 if not old_project: 66 if not old_project:
67 old_project = self.project_by_id(node.entry.project_id) 67 old_project = self.project_by_id(node.item.project_id)
68 except IndexError, err: 68 except IndexError, err:
69 pass 69 pass
70 finally: 70 finally:
71 self.backend.move_entries(entries, project.id) 71 self.backend.move_entries(entries, project.id)
72 if not old_project: return 72 if not old_project: return
81 entries = [] 81 entries = []
82 try: 82 try:
83 while True: 83 while True:
84 node = self.entries_view.selection.pop() 84 node = self.entries_view.selection.pop()
85 if node.selected: node.select() 85 if node.selected: node.select()
86 entries.append(node.entry) 86 entries.append(node.item)
87 logger.info("GetanController: delete entry '%s' (id = %d, "\ 87 logger.info("GetanController: delete entry '%s' (id = %d, "\
88 "project id = %d)" 88 "project id = %d)"
89 % (node.entry.desc, node.entry.id, 89 % (node.item.desc, node.item.id,
90 node.entry.project_id)) 90 node.item.project_id))
91 91
92 if proj is None: 92 if proj is None:
93 proj = self.project_by_id(node.entry.project_id) 93 proj = self.project_by_id(node.item.project_id)
94 except IndexError, err: 94 except IndexError, err:
95 pass 95 pass
96 finally: 96 finally:
97 self.backend.delete_entries(entries) 97 self.backend.delete_entries(entries)
98 proj.entries = self.backend.load_entries(proj.id) 98 proj.entries = self.backend.load_entries(proj.id)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)