django - invalid literal for int() with base 10: -


in view, error message: invalid literal int() base 10

views.py

author_id = request.post.get('id_author') input_author= engineer.objects.get(id=author_id) 

the items in post dictionary strings default. must convert them integers using int method:

author_id = int(request.post.get('id_author')) input_author = engineer.objects.get(id=author_id) 

Comments