这个django代码中的'额外'含义是什么?

时间:2010-04-05 06:50:41

标签: python sql django

TOPIC_COUNT_SQL = """
SELECT COUNT(*)
FROM topics_topic
WHERE
    topics_topic.object_id = maps_map.id AND
    topics_topic.content_type_id = %s
"""
MEMBER_COUNT_SQL = """
SELECT COUNT(*)
FROM maps_map_members
WHERE maps_map_members.map_id = maps_map.id
"""

maps = maps.extra(select=SortedDict([
    ('member_count', MEMBER_COUNT_SQL),
    ('topic_count', TOPIC_COUNT_SQL),
]), select_params=(content_type.id,))

我不知道这个意思,

感谢

1 个答案:

答案 0 :(得分:1)