[browser2] add a validate method in order to check objet before returning him
This commit is contained in:
parent
e7d09cbe31
commit
7d59640712
1 changed files with 4 additions and 0 deletions
|
|
@ -497,6 +497,7 @@ class ItemElement(AbstractElement):
|
|||
_attrs = None
|
||||
klass = None
|
||||
condition = None
|
||||
validate = None
|
||||
|
||||
class Index(object):
|
||||
pass
|
||||
|
|
@ -528,6 +529,9 @@ class ItemElement(AbstractElement):
|
|||
except SkipItem:
|
||||
return
|
||||
|
||||
if self.validate is not None and not self.validate_object(self.obj):
|
||||
return
|
||||
|
||||
yield self.obj
|
||||
|
||||
def handle_attr(self, key, func):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue