Added 'Link References' quickview; added a get_link to SimpleAccess

svn: r15348
This commit is contained in:
Doug Blank
2010-05-07 12:59:23 +00:00
parent 6846befb21
commit 99c4671e3e
5 changed files with 100 additions and 0 deletions

View File

@@ -919,6 +919,17 @@ class SimpleAccess(object):
else:
return "Error: invalid object class: '%s'" % object_class
def get_link(self, object_class, prop, value):
"""
Given a object_class, prop, and value return the object.
object_class is "Person", "Source", etc.
prop is "gramps_id", or "handle"
value is a gramps_id or handle.
"""
if object_class in self.dbase.get_table_names():
return self.dbase.get_table_metadata(object_class) \
[prop + "_func"](value)
def by_date(event1, event2):
"""
Sort function that will compare two events by their dates.