Opened 4 years ago
Closed 4 years ago
#32767 closed Bug (invalid)
inspectdb and sql non-boolean issues
Reported by: | kinglion | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 3.2 |
Severity: | Release blocker | Keywords: | inspectdb, mssql, non-boolean |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
enviornment:
python: 3.8
django: 3.2.3
pyodbc: 4.0.03
django-mssql-backend: 2.8.1
I'm sure the database config is correct.
- when I run: python manage.py inspectdb, it come out issues like this:
# Unable to inspect table 'AllowList' # The error was: __new__() missing 1 required positional argument: 'collation'
ps: when I change django version to 3.1x or 2.x, inspectdb can produce model.
- when I use
filetypes = Uploadfiletypes.objects.filter(status=True).order_by('filetype')
it produce this issue:
('42000', "[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]An expression of non-boolean type specified in a context where a condition is expected, near 'ORDER'. (4145) (SQLExecDirectW)")
I'm sure status is a boolean field, and True is a boolean type value. when I change the django version to 2.x, it don't have this issue.
Note:
See TracTickets
for help on using tickets.
This is not an issue in Django but in
django-mssql-backend
. Moreoverdjango-mssql-backend
doesn't officially support Django 3.2.