diff -r 59e032315ab9 -r b07d52d49db7 pytask/taskapp/views/utils.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pytask/taskapp/views/utils.py Tue Feb 01 02:31:53 2011 +0530 @@ -0,0 +1,26 @@ +"""Module containing taskapp views specific utility functions +""" + +__authors__ = [ + '"Madhusudan.C.S" ', + ] + + +def get_intial_tags_for_chapter(textbook): + """Returns the initial tag set for chapter/module for the textbook. + + Args: + textbook: textbook entity for which the tags should be built. + """ + + tags1=textbook.tags_field + tags = textbook.tags_field.split(',') + rebuild_tags = [] + for tag in tags: + tag.strip() + if 'Textbook' not in tag: + rebuild_tags.append(tag) + + initial_tags = ', '.join(rebuild_tags + ['Chapter']) + + return initial_tags \ No newline at end of file