このコードを機能させるのに問題があります:
count_bicycleadcategory = 0
for item_bicycleadcategory in some_list_with_integers:
exec 'model_bicycleadcategory_%s.bicycleadcategorytype = BicycleAdCategoryType.objects.get(pk=' + str(item_bicycleadcategory) + ')' % count_bicycleadcategory
count_bicycleadcategory = count_bicycleadcategory + 1
エラーが発生します:
Type Error, not all arguments converted during string formatting
私の質問は次のとおりです。「item_bicycleadcategory」をexec式に渡す方法の手がかりはありますか?
よろしくお願いします、