'has_location'および'locations'というテーブルがあります。'has_location'は、 django自体によって与えられるuser_hasandlocation_idとそれ自身を持っています。id
「場所」にはより多くの列があります。
ここで、特定のユーザーのすべての場所を取得したいと思います。私がしたことは..(user.idは既知です):
users_locations_id = has_location.objects.filter(user_has__exact=user.id)
locations = Location.objects.filter(id__in=users_locations_id)
print len(locations)
しかし、私はこれでやって0いますprint。dbにデータがあります。__inでもモデルIDを受け入れない気がしますね。
ありがとう