Django queryset objects return None instead of 0 even though the database has 0 stored as the field value
问题 I encountered a problem when I started using mysql-connector/python instead of mysqlclient for my Django project. Suddenly values stored as 0 in the database is turned to "None" in the resulting queryset, here's an example. queryset = Invoices.objects.all().filter(sold=0) print(queryset[0].sold) # Prints "None" Where the same statement would have printed 0 with mysqlclient. Is there a good way to fix this? I haven't gotten mysqlclient to work well with my current setup and would rather not