Merge pull request #3181 from volundmush/attr_fix
Small fix to the AttributeHandler.all(). Fixes #3160
This commit is contained in:
commit
a8da04f6cf
1 changed files with 4 additions and 1 deletions
|
|
@ -1390,11 +1390,12 @@ class AttributeHandler:
|
||||||
"""
|
"""
|
||||||
self.backend.clear_attributes(category, accessing_obj, default_access)
|
self.backend.clear_attributes(category, accessing_obj, default_access)
|
||||||
|
|
||||||
def all(self, accessing_obj=None, default_access=True):
|
def all(self, category=None, accessing_obj=None, default_access=True):
|
||||||
"""
|
"""
|
||||||
Return all Attribute objects on this object, regardless of category.
|
Return all Attribute objects on this object, regardless of category.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
category (str, optional): A given category to limit results to.
|
||||||
accessing_obj (object, optional): Check the `attrread`
|
accessing_obj (object, optional): Check the `attrread`
|
||||||
lock on each attribute before returning them. If not
|
lock on each attribute before returning them. If not
|
||||||
given, this check is skipped.
|
given, this check is skipped.
|
||||||
|
|
@ -1408,6 +1409,8 @@ class AttributeHandler:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
attrs = self.backend.get_all_attributes()
|
attrs = self.backend.get_all_attributes()
|
||||||
|
if category:
|
||||||
|
attrs = [attr for attr in attrs if attr.category == category]
|
||||||
|
|
||||||
if accessing_obj:
|
if accessing_obj:
|
||||||
return [
|
return [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue