Skip to content

Commit

Permalink
Merge pull request #10 from grongierisc/main
Browse files Browse the repository at this point in the history
fix introspection to fulfill display_size
  • Loading branch information
daimor authored Dec 19, 2023
2 parents dcc52a5 + b247610 commit 8486cb0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Prerequisites
You must install, the latest version of InterSystems IRIS DB-API Python driver

```shell
pip3 install intersystems_irispython-3.2.0-py3-none-any.whl
pip3 install https://github.com/intersystems-community/intersystems-irispython/releases/download/3.7.3/intersystems_iris-3.7.3-py3-none-any.whl
```

Install and usage
Expand Down
9 changes: 5 additions & 4 deletions django_iris/introspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from django.db.models import Index
from django.utils.datastructures import OrderedSet

MAXLEN = 65535

FieldInfo = namedtuple(
'FieldInfo', BaseFieldInfo._fields + ('auto_increment', ))

Expand Down Expand Up @@ -94,10 +96,9 @@ def get_table_description(self, cursor, table_name):
description = [
FieldInfo(
name,
'longvarchar'
if data_type == 'varchar' and length == '-1' else data_type,
None,
length,
'longvarchar' if data_type == 'varchar' and length == '-1' else data_type,
MAXLEN if not isinstance(length, int) or data_type != 'varchar' else length,
MAXLEN if not isinstance(length, int) or data_type != 'varchar' else length,
precision,
scale,
isnull == 'YES',
Expand Down
5 changes: 4 additions & 1 deletion django_iris/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
from datetime import date, datetime,timedelta
from django.utils.encoding import force_str
from django.utils.dateparse import parse_date, parse_datetime, parse_time
from django.db.backends.base.base import timezone_constructor
try:
from django.db.backends.base.base import timezone_constructor # Django 4.2
except ImportError:
from django.utils.timezone import timezone as timezone_constructor # Django 5+

from .utils import BulkInsertMapper

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/intersystems-community/intersystems-irispython/releases/download/3.6.3/intersystems_iris-3.6.3-py3-none-any.whl
https://github.com/intersystems-community/intersystems-irispython/releases/download/3.7.3/intersystems_iris-3.7.3-py3-none-any.whl

0 comments on commit 8486cb0

Please sign in to comment.