| random_code | varchar(200) | YES | UNI | NULL | |
MyTable.objects.filter(random_code = None)
Is this correct? Will this SELECT where there is no random code set? Above is my table.
| random_code | varchar(200) | YES | UNI | NULL | |
MyTable.objects.filter(random_code = None)
Is this correct? Will this SELECT where there is no random code set? Above is my table.
If you ever want to see what your QuerySet
as SQL you can use QuerySet.query.as_sql()
to return the SQL statement as a string.
This has been asked here. Basically you do this:
MyTable.objects.filter(random_code__isnull=True)