Add PDBTagMixin.get_root_tags

master
voussoir 2017-06-11 22:57:08 -07:00
parent d10fe47dc4
commit ac2b820a30
1 changed files with 5 additions and 0 deletions

View File

@ -889,6 +889,11 @@ class PDBTagMixin:
def get_tags(self): def get_tags(self):
yield from self.get_things(thing_type='tag') yield from self.get_things(thing_type='tag')
def get_root_tags(self):
for tag in self.get_tags():
if tag.parent() is None:
yield tag
@decorators.required_feature('enable_new_tag') @decorators.required_feature('enable_new_tag')
@decorators.transaction @decorators.transaction
def new_tag(self, tagname, description=None, *, commit=True): def new_tag(self, tagname, description=None, *, commit=True):