4

プロジェクトのクリーニングを終了しました。役に立たないアプリやコードを削除して整理します。この後、エラーが発生しました

TypeError: object of type 'instancemethod' has no len()

count() に変更しましたが、再びエラーが発生しました

AttributeError: 'function' object has no attribute 'count'

これが私のコードです:

def budget(request):
    envelopes = Envelope.objects.filter(
         user=request.user).exclude_unallocated

    return render(request, 'budget.html', {
        'limit': account_limit(request, 15, envelopes),
    }


def account_limit(request, value, query):
    count_objects = len(query)

    //other codes here

    return result

ここで何かを削除したと思うので、エラーが発生しています

4

1 に答える 1

10

()を入れ忘れた

 envelopes = Envelope.objects.filter(user=request.user).exclude_unallocated()
于 2013-02-26T09:14:37.747 に答える