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

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -