[Django] #32767: inspectdb and sql non-boolean issues

29 views
Skip to first unread message

Django

unread,
May 19, 2021, 6:47:37 AM5/19/21
to django-...@googlegroups.com
#32767: inspectdb and sql non-boolean issues
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
kinglion580 |
Type: Bug | Status: new
Component: Database | Version: 3.2
layer (models, ORM) |
Severity: Release | Keywords: inspectdb, mssql,
blocker | non-boolean
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
**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.


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

--
Ticket URL: <https://code.djangoproject.com/ticket/32767>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 19, 2021, 6:52:13 AM5/19/21
to django-...@googlegroups.com
#32767: inspectdb and sql non-boolean issues
-------------------------------------+-------------------------------------
Reporter: kinglion580 | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Release blocker | Resolution: invalid
Keywords: inspectdb, mssql, | Triage Stage:
non-boolean | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => invalid


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/32767#comment:1>

Reply all
Reply to author
Forward
0 new messages