Merge branch 'develop' into smarturls

This commit is contained in:
Johnny 2018-10-22 13:58:34 -07:00 committed by GitHub
commit b414eadff2
35 changed files with 485 additions and 190 deletions

View file

@ -668,7 +668,7 @@ class AttributeHandler(object):
def all(self, accessing_obj=None, default_access=True):
"""
Return all Attribute objects on this object.
Return all Attribute objects on this object, regardless of category.
Args:
accessing_obj (object, optional): Check the `attrread`

View file

@ -345,13 +345,14 @@ class TagHandler(object):
self._catcache = {}
self._cache_complete = False
def all(self, return_key_and_category=False):
def all(self, return_key_and_category=False, return_objs=False):
"""
Get all tags in this handler, regardless of category.
Args:
return_key_and_category (bool, optional): Return a list of
tuples `[(key, category), ...]`.
return_objs (bool, optional): Return tag objects.
Returns:
tags (list): A list of tag keys `[tagkey, tagkey, ...]` or
@ -365,6 +366,8 @@ class TagHandler(object):
if return_key_and_category:
# return tuple (key, category)
return [(to_str(tag.db_key), to_str(tag.db_category)) for tag in tags]
elif return_objs:
return tags
else:
return [to_str(tag.db_key) for tag in tags]