+ terms = search_string.split()
+ for tag in terms:
+ if ':' in tag:
+ # This is a special tag; at the moment, by/for/of to indicate
+ # related users
+ prefix, tag = tag.split(':', 1)
+
+ # XXX what to do if this fails? abort? return empty query?
+ target_user = User.get_by(name=tag)
+
+ if prefix == 'by':
+ rel = ArtUserType.BY
+ elif prefix == 'for':
+ rel = ArtUserType.FOR
+ elif prefix == 'of':
+ rel = ArtUserType.OF
+ else:
+ # Bogus tag. Not sure what to do here, so for the moment,
+ # ignore it
+ continue