[Answered ]-Django won't import values to database – sqlite3

2πŸ‘

βœ…

This is happening because you are not fetching Language objects properly.

When you do Language(id=1).code, You are instantiating Language object with no value in given to code field.

In django, to fetch a object, you do Model.objects.get(field=value). So your code becomes:

Language.objects.get(id=1).code
πŸ‘€v1k45

Leave a comment