for tag, count in baseq.join(Tag.nodes).group_by(Tag.id).all():
        tags[tag]['nodes'] = count