unsupported operand type(s) for -: 'str' and 'int'

배롱·2022년 12월 3일
0
pybo_filter.py", line 7, in sub
    return value - arg
TypeError: unsupported operand type(s) for -: 'str' and 'int'
@register.filter
def sub(value, arg):
    return value - arg

로그 내용만 보아도 타입문제인 줄 알고 이것저것 시도를 많이 했다.
html내에서 console로 로그를 찍어보는데 값이 문제없이 출력되었다

(index):53 question.count type :  number
(index):54 question.start type :  number

그래서 다시 자세히 코드 내용을 들여다보니 오타가 있었다.
하하.

0개의 댓글