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.

  1. 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.

  1. 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.

Change History (1)

comment:1 by Mariusz Felisiak, 4 years ago

Resolution: invalid
Status: newclosed

This is not an issue in Django but in django-mssql-backend. Moreover django-mssql-backend doesn't officially support Django 3.2.

Note: See TracTickets for help on using tickets.
Back to Top