Difference between revisions of "RelatedPersons"

From Gramps
Jump to: navigation, search
(Versions)
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category:Plugins]]
+
{{Third-party plugin}}
[[Category:Developers/General]]
 
  
== MAIN ==
+
== Main ==
  
  The Data of the different family trees can be manipuled by “FamilyGroups” which distinguish the '''unrelated groups'''.
+
  The Data of the different family trees can be manipulated by “FamilyGroups” which distinguish the '''unrelated groups'''.
 
    
 
    
 
  "'''_RelatedPersons'''" is the new General filter  for " Matches people with related home-person "
 
  "'''_RelatedPersons'''" is the new General filter  for " Matches people with related home-person "
Line 24: Line 23:
 
     ( Matches people with related home-person )
 
     ( Matches people with related home-person )
  
== PATCHS ==
+
== Versions ==
 +
 
 +
* 1.0 The first
 +
* 1.1 Without numeric module, not available for Windows.
 +
 
 +
 
 +
Original download path gone http://www.jfchasse.fr/_RelatedPersons.py.zip
 +
 
 +
== Possible patches ! ==
  
 
=== To allow person selection on filter ===
 
=== To allow person selection on filter ===
Line 41: Line 48:
 
   
 
   
 
       def prepare (self, database):
 
       def prepare (self, database):
 +
 +
+ need to modify current code => ''Home person (ID)'' will be ''Selected person (ID)''
  
 
=== To set the rule as a generic filter rule for export (GRAMPS XML, GEDCOM) ===
 
=== To set the rule as a generic filter rule for export (GRAMPS XML, GEDCOM) ===
Line 46: Line 55:
 
  --- ExportOptions.py 2009-02-16 18:01:08.000000000 +0100
 
  --- ExportOptions.py 2009-02-16 18:01:08.000000000 +0100
 
  +++ ExportOptions.py 2009-03-31 14:12:46.000000000 +0200
 
  +++ ExportOptions.py 2009-03-31 14:12:46.000000000 +0200
@@ -160,8 +160,12 @@
+
  @@ -160,8 +160,12 @@
 
           com = GenericFilter()
 
           com = GenericFilter()
 
           com.set_name(_("People with common ancestor with %s") % name)
 
           com.set_name(_("People with common ancestor with %s") % name)
Line 59: Line 68:
 
   
 
   
 
       def parse_options(self):
 
       def parse_options(self):
 +
 +
=== To set the rule as a generic filter rule for reports and not primary formats on export (GeneWeb, csv) ===
 +
 +
--- ReportBase/_ReportUtils.py 2009-02-16 17:59:26.000000000 +0100
 +
+++ ReportBase/_ReportUtils.py 2009-03-31 14:21:08.000000000 +0200
 +
@@ -3180,11 +3180,15 @@
 +
      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]))
 +
 +
      if include_single:
 +
-        the_filters = [filt_id, all, des, df, ans, com]
 +
+        the_filters = [filt_id, all, des, df, ans, com, rel]
 +
      else:
 +
-        the_filters = [all, des, df, ans, com]
 +
+        the_filters = [all, des, df, ans, com, rel]
 +
      the_filters.extend(CustomFilters.get_filters('Person'))
 +
      return the_filters
 +
 +
[[Category:Plugins]]
 +
[[Category:Developers/General]]
 +
[[Category:Reports]]

Revision as of 00:05, 26 December 2014

Gramps-notes.png

Please use carefully on data that is backed up, and help make it better by reporting any comments or problems to the author, or issues to the bug tracker
Unless otherwise stated on this page, you can download this addon by following these instructions.
Please note that some Addons have prerequisites that need to be installed before they can be used.
This Addon/Plugin system is controlled by the Plugin Manager.


Main

The Data of the different family trees can be manipulated 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 )

Versions

  • 1.0 The first
  • 1.1 Without numeric module, not available for Windows.


Original download path gone http://www.jfchasse.fr/_RelatedPersons.py.zip

Possible patches !

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):

+ need to modify current code => Home person (ID) will be Selected person (ID)

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):

To set the rule as a generic filter rule for reports and not primary formats on export (GeneWeb, csv)

--- ReportBase/_ReportUtils.py 2009-02-16 17:59:26.000000000 +0100
+++ ReportBase/_ReportUtils.py 2009-03-31 14:21:08.000000000 +0200
@@ -3180,11 +3180,15 @@
     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]))

     if include_single:
-        the_filters = [filt_id, all, des, df, ans, com]
+        the_filters = [filt_id, all, des, df, ans, com, rel]
     else:
-        the_filters = [all, des, df, ans, com]
+        the_filters = [all, des, df, ans, com, rel]
     the_filters.extend(CustomFilters.get_filters('Person'))
     return the_filters