* src/GenericFilter.py: Proper test for place in event-based filters.
svn: r4922
This commit is contained in:
parent
1b18e85c18
commit
996bc358ae
@ -1,3 +1,6 @@
|
|||||||
|
2005-07-13 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* src/GenericFilter.py: Proper test for place in event-based filters.
|
||||||
|
|
||||||
2005-07-13 Don Allingham <don@gramps-project.org>
|
2005-07-13 Don Allingham <don@gramps-project.org>
|
||||||
* src/GrampsInMemDB.py: add get_event_cursor
|
* src/GrampsInMemDB.py: add get_event_cursor
|
||||||
* src/GrampsDbBase.py: add get_event_cursor
|
* src/GrampsDbBase.py: add get_event_cursor
|
||||||
|
@ -999,7 +999,7 @@ class HasEvent(Rule):
|
|||||||
description = _("Matches people with a personal event of a particular value")
|
description = _("Matches people with a personal event of a particular value")
|
||||||
category = _('Event filters')
|
category = _('Event filters')
|
||||||
|
|
||||||
def prepare(self,list):
|
def prepare(self,db):
|
||||||
self.date = None
|
self.date = None
|
||||||
try:
|
try:
|
||||||
if self.list and self.list[1]:
|
if self.list and self.list[1]:
|
||||||
@ -1048,7 +1048,7 @@ class HasFamilyEvent(Rule):
|
|||||||
description = _("Matches people with a family event of a particular value")
|
description = _("Matches people with a family event of a particular value")
|
||||||
category = _('Event filters')
|
category = _('Event filters')
|
||||||
|
|
||||||
def prepare(self,list):
|
def prepare(self,db):
|
||||||
self.date = None
|
self.date = None
|
||||||
try:
|
try:
|
||||||
if self.list and self.list[1]:
|
if self.list and self.list[1]:
|
||||||
@ -1071,12 +1071,16 @@ class HasFamilyEvent(Rule):
|
|||||||
if self.date:
|
if self.date:
|
||||||
if date_cmp(self.date,event.get_date_object()):
|
if date_cmp(self.date,event.get_date_object()):
|
||||||
val = 0
|
val = 0
|
||||||
pl_id = event.get_place_handle()
|
if self.list[2]:
|
||||||
if pl_id:
|
pl_id = event.get_place_handle()
|
||||||
pl = db.get_place_from_handle(pl_id)
|
if pl_id:
|
||||||
pn = pl.get_title()
|
pl = db.get_place_from_handle(pl_id)
|
||||||
if self.list[2] and pn.find(self.list[2].upper()) == -1:
|
pn = pl.get_title().upper()
|
||||||
|
if pn.find(self.list[2].upper()) == -1:
|
||||||
|
val = 0
|
||||||
|
else:
|
||||||
val = 0
|
val = 0
|
||||||
|
|
||||||
if val == 1:
|
if val == 1:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
@ -1158,16 +1162,20 @@ class HasBirth(Rule):
|
|||||||
return False
|
return False
|
||||||
event = db.get_event_from_handle(event_handle)
|
event = db.get_event_from_handle(event_handle)
|
||||||
ed = event.get_description().upper()
|
ed = event.get_description().upper()
|
||||||
if len(self.list) > 2 and ed.find(self.list[2].upper())==-1:
|
if len(self.list) > 2 and self.list[2] \
|
||||||
|
and ed.find(self.list[2].upper())==-1:
|
||||||
return False
|
return False
|
||||||
if self.date:
|
if self.date:
|
||||||
if date_cmp(self.date,event.get_date_object()) == 0:
|
if date_cmp(self.date,event.get_date_object()) == 0:
|
||||||
return False
|
return False
|
||||||
pl_id = event.get_place_handle()
|
if len(self.list)>1 and self.list[1]:
|
||||||
if pl_id:
|
pl_id = event.get_place_handle()
|
||||||
pl = db.get_place_from_handle(pl_id)
|
if pl_id:
|
||||||
pn = pl.get_title()
|
pl = db.get_place_from_handle(pl_id)
|
||||||
if len(self.list) > 1 and pn.find(self.list[1].upper()) == -1:
|
pn = pl.get_title().upper
|
||||||
|
if pn.find(self.list[1].upper()) == -1:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -1197,16 +1205,20 @@ class HasDeath(Rule):
|
|||||||
return False
|
return False
|
||||||
event = db.get_event_from_handle(event_handle)
|
event = db.get_event_from_handle(event_handle)
|
||||||
ed = event.get_description().upper()
|
ed = event.get_description().upper()
|
||||||
if self.list[2] and ed.find(self.list[2].upper())==-1:
|
if len(self.list)>2 and self.list[2] \
|
||||||
|
and ed.find(self.list[2].upper())==-1:
|
||||||
return False
|
return False
|
||||||
if self.date:
|
if self.date:
|
||||||
if date_cmp(self.date,event.get_date_object()) == 0:
|
if date_cmp(self.date,event.get_date_object()) == 0:
|
||||||
return False
|
return False
|
||||||
pl_id = event.get_place_handle()
|
if len(self.list)>1 and self.list[1]:
|
||||||
if pl_id:
|
pl_id = event.get_place_handle()
|
||||||
pl = db.get_place_from_handle(pl_id)
|
if pl_id:
|
||||||
pn = pl.get_title()
|
pl = db.get_place_from_handle(pl_id)
|
||||||
if self.list[1] and pn.find(self.list[1].upper()) == -1:
|
pn = pl.get_title().upper()
|
||||||
|
if self.list[1] and pn.find(self.list[1].upper()) == -1:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user