diff --git a/README.md b/README.md index 61418c2..93a5449 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/django_iris/introspection.py b/django_iris/introspection.py index f4837df..112f618 100644 --- a/django_iris/introspection.py +++ b/django_iris/introspection.py @@ -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', )) @@ -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', diff --git a/django_iris/operations.py b/django_iris/operations.py index 3f107b3..bd1d1c4 100644 --- a/django_iris/operations.py +++ b/django_iris/operations.py @@ -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 diff --git a/requirements.txt b/requirements.txt index 2155958..8ed432e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -https://github.com/intersystems-community/intersystems-irispython/releases/download/3.6.3/intersystems_iris-3.6.3-py3-none-any.whl \ No newline at end of file +https://github.com/intersystems-community/intersystems-irispython/releases/download/3.7.3/intersystems_iris-3.7.3-py3-none-any.whl \ No newline at end of file