2008-01-15 Douglas S. Blank <dblank@cs.brynmawr.edu>
* src/plugins/SameSurnames.py (IncompleteSurname.apply): can bring up people with empty surname * src/plugins/ImportCSV.py (CSVParser.process): fixed csv import with no surname (bug #1603) svn: r9826
This commit is contained in:
parent
7971b173ca
commit
a5a349219a
@ -1,10 +1,14 @@
|
||||
2008-01-15 Douglas S. Blank <dblank@cs.brynmawr.edu>
|
||||
* src/plugins/SameSurnames.py (IncompleteSurname.apply):
|
||||
can bring up people with empty surname
|
||||
|
||||
2008-01-15 Raphael Ackermann <raphael.ackermann@gmail.com>
|
||||
* src/FilterEditor/_ShowResults.py: allow notes to be filtered
|
||||
0001607: Unreferenced filter test
|
||||
|
||||
2008-01-15 Douglas S. Blank <dblank@cs.brynmawr.edu>
|
||||
* src/plugins/ImportCSV.py (CSVParser.process): fixed csv import with no
|
||||
surname (bug #1603)
|
||||
* src/plugins/ImportCSV.py (CSVParser.process): fixed csv import with
|
||||
no surname (bug #1603)
|
||||
|
||||
2008-01-15 Douglas S. Blank <dblank@cs.brynmawr.edu>
|
||||
* src/plugins/DefaultGramplets.py (TopSurnamesGramplet.main): make
|
||||
|
@ -27,9 +27,21 @@ from Simple import SimpleAccess, SimpleDoc, SimpleTable
|
||||
from gettext import gettext as _
|
||||
from PluginUtils import register_quick_report
|
||||
from ReportBase import CATEGORY_QR_PERSON
|
||||
from Filters.Rules import Rule
|
||||
from Filters.Rules.Person import SearchName
|
||||
from Filters import GenericFilterFactory, Rules
|
||||
|
||||
class IncompleteSurname(Rule):
|
||||
"""People with incomplete surnames"""
|
||||
name = _('People with incomplete surnames')
|
||||
description = _("Matches people with lastname missing")
|
||||
category = _('General filters')
|
||||
def apply(self,db,person):
|
||||
for name in [person.get_primary_name()] + person.get_alternate_names():
|
||||
if name.get_surname() == "":
|
||||
return True
|
||||
return False
|
||||
|
||||
def run(database, document, person):
|
||||
"""
|
||||
Loops through the families that the person is a child in, and display
|
||||
@ -46,7 +58,10 @@ def run(database, document, person):
|
||||
# grab our current id (self):
|
||||
gid = sdb.gid(person)
|
||||
filter = GenericFilterFactory('Person')()
|
||||
rule = SearchName([person.get_primary_name().get_surname()])
|
||||
if person.get_primary_name().get_surname() != '':
|
||||
rule = SearchName([person.get_primary_name().get_surname()])
|
||||
else:
|
||||
rule = IncompleteSurname([])
|
||||
filter.add_rule(rule)
|
||||
people = filter.apply(database,
|
||||
database.get_person_handles(sort_handles=False))
|
||||
|
Loading…
Reference in New Issue
Block a user