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
.
精彩评论