开发者

what is the 'extra' mean in this django code

TOPIC_COUNT_SQL = """
SELECT COUNT(*)
FROM topics_topic
WHERE
    topics_topic.object_id = maps_ma开发者_如何学编程p.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,))

i don't know this mean,

thanks


It's a method of QuerySet.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜