::
counters = Counter.objects.raw("""
SELECT id, name FROM building_counter c
INNER JOIN scope_scope_buildings ssb
ON c.building_id = ssb.building_id
AND ssb.scope_id = %s
WHERE energy_id = %s
AND parent_id is not NULL
AND type = "C"
""", [self.id, energy_id])
The result gave me :
TypeError: not enough arguments for format string
[2, 1L]
I don t understand what s wrong with it :s