From ad1babbd4c9219d8a3e8c2e60c933d4684a77511 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Tue, 12 May 2015 22:10:40 -0400 Subject: [PATCH] DbDjango: added missing methods --- gramps/webapp/dbdjango.py | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/gramps/webapp/dbdjango.py b/gramps/webapp/dbdjango.py index 8d765640f..49fc3c5e5 100644 --- a/gramps/webapp/dbdjango.py +++ b/gramps/webapp/dbdjango.py @@ -1951,3 +1951,57 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback): def get_dbname(self): return "Django Database" + + ## missing + + def find_place_child_handles(self, handle): + pass + + def get_cursor(self, table, txn=None, update=False, commit=False): + pass + + def get_from_name_and_handle(self, table_name, handle): + """ + Returns a gen.lib object (or None) given table_name and + handle. + + Examples: + + >>> self.get_from_name_and_handle("Person", "a7ad62365bc652387008") + >>> self.get_from_name_and_handle("Media", "c3434653675bcd736f23") + """ + if table_name in self._tables: + return self._tables[table_name]["handle_func"](handle) + return None + + def get_number_of_records(self, table): + pass + + def get_place_parent_cursor(self): + pass + + def get_place_tree_cursor(self): + pass + + def get_table_metadata(self, table_name): + """Return the metadata for a valid table name.""" + if table_name in self._tables: + return self._tables[table_name] + return None + + def get_transaction_class(self): + pass + + def undo(self, update_history=True): + # FIXME: + return self.undodb.undo(update_history) + + def redo(self, update_history=True): + # FIXME: + return self.undodb.redo(update_history) + + def backup(self): + pass + + def restore(self): + pass