Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

123
Vistas
ValueError: invalid literal for int() with base 10(Django)

error in cmd
Code

I tried to create a project where to manage a garage, but when I create the model in application"utiliser", I got this problem. Thanks!

8 months ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

In your code, you are trying to assign string client as the default value for your ForeignKey. ForeignKeys are represented as integers and that is why you get this error. You can assign id value of the foreign object (if exists), or use null=True which will make default NULL. If there is no data at all in this object, then remove default value, migrations and flush database, then you will get not-nullable ForeignKey field.

8 months ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.