Difference between revisions of "RelatedPersons"

From Gramps
Jump to: navigation, search
Line 10: Line 10:
  
 
  On root,
 
  On root,
.
+
  .
 
  Copy "_RelatedPerson" in gramps/Filters/rules/Person
 
  Copy "_RelatedPerson" in gramps/Filters/rules/Person
 
  .
 
  .
Line 17: Line 17:
 
  Modify the "__init__.py" in gramps/Filters/rules/Person
 
  Modify the "__init__.py" in gramps/Filters/rules/Person
 
  .
 
  .
add two lines
+
  add two lines
 
  ..... from _RelatedPersons import RelatedPersons (first party)
 
  ..... from _RelatedPersons import RelatedPersons (first party)
 
  ..... RelatedPersons,                            (second party)
 
  ..... RelatedPersons,                            (second party)
Line 23: Line 23:
 
  and test the '''unrelated groups''' for filtering  or exporting
 
  and test the '''unrelated groups''' for filtering  or exporting
 
     ( Matches people with related home-person )
 
     ( Matches people with related home-person )
 +
 +
== PATCHS ==
 +
 +
=== To allow person selection on filter ===
 +
 +
--- Filters/Rules/Person/_RelatedPersons.py 2009-03-29 22:42:52.000000000 +0200
 +
+++ Filters/Rules/Person/_RelatedPersons.py 2009-03-31 14:12:15.000000000 +0200
 +
@@ -38,8 +38,9 @@
 +
  class RelatedPersons(Rule):
 +
      """People with with related active person"""
 +
-    name        = _('People with related home-person')
 +
-    description = _("Matches people with related home-person")
 +
+    labels      = [ _('ID:') ]
 +
+    name        = _('People related with <person>')
 +
+    description = _("Matches people related with a person")
 +
      category    = _('General filters')
 +
 +
      def prepare (self, database):
 +
 +
=== To set the rule as a generic filter rule for export (GRAMPS XML, GEDCOM) ===
 +
 +
--- ExportOptions.py 2009-02-16 18:01:08.000000000 +0100
 +
+++ ExportOptions.py 2009-03-31 14:12:46.000000000 +0200
 +
@@ -160,8 +160,12 @@
 +
          com = GenericFilter()
 +
          com.set_name(_("People with common ancestor with %s") % name)
 +
          com.add_rule(Rules.Person.HasCommonAncestorWith([gramps_id]))
 +
+   
 +
+        rel = GenericFilter()
 +
+        rel.set_name(_("People related with %s") % name)
 +
+        rel.add_rule(Rules.Person.RelatedPersons([gramps_id]))
 +
 +
-        return [des, df, ans, com]
 +
+        return [des, df, ans, com, rel]
 +
 +
      def parse_options(self):

Revision as of 12:31, 31 March 2009


MAIN

The Data of the different family trees can be manipuled by “FamilyGroups” which distinguish the unrelated groups.
 
"_RelatedPersons" is the new General filter  for " Matches people with related home-person "


On root,
 .
Copy "_RelatedPerson" in gramps/Filters/rules/Person
.
AND
.
Modify the "__init__.py" in gramps/Filters/rules/Person
.
 add two lines
..... from _RelatedPersons import RelatedPersons (first party)
..... RelatedPersons,                            (second party)
.
and test the unrelated groups for filtering  or exporting
   ( Matches people with related home-person )

PATCHS

To allow person selection on filter

--- Filters/Rules/Person/_RelatedPersons.py 2009-03-29 22:42:52.000000000 +0200
+++ Filters/Rules/Person/_RelatedPersons.py 2009-03-31 14:12:15.000000000 +0200
@@ -38,8 +38,9 @@
 class RelatedPersons(Rule):
     """People with with related active person"""
-    name        = _('People with related home-person')
-    description = _("Matches people with related home-person")
+    labels      = [ _('ID:') ]
+    name        = _('People related with <person>')
+    description = _("Matches people related with a person")
     category    = _('General filters')

     def prepare (self, database):

To set the rule as a generic filter rule for export (GRAMPS XML, GEDCOM)

--- ExportOptions.py 2009-02-16 18:01:08.000000000 +0100
+++ ExportOptions.py 2009-03-31 14:12:46.000000000 +0200
@@ -160,8 +160,12 @@
         com = GenericFilter()
         com.set_name(_("People with common ancestor with %s") % name)
         com.add_rule(Rules.Person.HasCommonAncestorWith([gramps_id]))
+    
+        rel = GenericFilter()
+        rel.set_name(_("People related with %s") % name)
+        rel.add_rule(Rules.Person.RelatedPersons([gramps_id]))

-        return [des, df, ans, com]
+        return [des, df, ans, com, rel]

     def parse_options(self):