Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ python -m pip install -U pip
pip install -e .

# Install django and test dependencies
git clone --branch mongodb-6.0.x https://github.com/mongodb-forks/django django_repo
git clone --branch mongodb-6.1.x https://github.com/mongodb-forks/django django_repo
pushd django_repo/tests/
pip install -e ..
pip install -r requirements/py3.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-python-atlas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: actions/checkout@v6
with:
repository: 'mongodb-forks/django'
ref: 'mongodb-6.0.x'
ref: 'mongodb-6.1.x'
path: 'django_repo'
persist-credentials: false
- name: Install system packages for Django's Python test dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-python-geo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions/checkout@v6
with:
repository: 'mongodb-forks/django'
ref: 'mongodb-6.0.x'
ref: 'mongodb-6.1.x'
path: 'django_repo'
persist-credentials: false
- name: Install system packages for Django's Python test dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: actions/checkout@v6
with:
repository: 'mongodb-forks/django'
ref: 'mongodb-6.0.x'
ref: 'mongodb-6.1.x'
path: 'django_repo'
persist-credentials: false
- name: Install system packages for Django's Python test dependencies
Expand Down
2 changes: 1 addition & 1 deletion django_mongodb_backend/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "6.0.1.dev0"
__version__ = "6.1.0.dev0"

# Check Django compatibility before other imports which may fail if the
# wrong version of Django is installed.
Expand Down
5 changes: 5 additions & 0 deletions django_mongodb_backend/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class DatabaseFeatures(GISFeatures, BaseDatabaseFeatures):
supports_json_field_contains = False
# BSON Date type doesn't support microsecond precision.
supports_microsecond_precision = False
supports_on_delete_db_cascade = False
supports_on_delete_db_default = False
supports_on_delete_db_null = False
supports_paramstyle_pyformat = False
supports_select_difference = False
supports_select_intersection = False
Expand Down Expand Up @@ -465,6 +468,8 @@ def django_test_expected_failures(self):
# There is no way to distinguish between a JSON "null" (represented
# by Value(None, JSONField())) and a SQL null (queried using the
# isnull lookup). Both of these queries return both nulls.
"model_fields.test_jsonfield.JSONExactNoneDeprecationTests",
"model_fields.test_jsonfield.JSONNullTests",
"model_fields.test_jsonfield.TestSaveLoad.test_json_null_different_from_sql_null",
# Some queries with Q objects, e.g. Q(value__foo="bar"), don't work
# properly, particularly with QuerySet.exclude().
Expand Down
2 changes: 0 additions & 2 deletions django_mongodb_backend/fields/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from .array import ArrayField
from .auto import ObjectIdAutoField
from .duration import register_duration_field
from .embedded_model import EmbeddedModelField
from .embedded_model_array import EmbeddedModelArrayField
from .json import register_json_field
Expand All @@ -21,5 +20,4 @@


def register_fields():
register_duration_field()
register_json_field()
18 changes: 0 additions & 18 deletions django_mongodb_backend/fields/duration.py

This file was deleted.

9 changes: 9 additions & 0 deletions django_mongodb_backend/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ def adapt_decimalfield_value(self, value, max_digits=None, decimal_places=None):
return None
return Decimal128(value)

def adapt_durationfield_value(self, value):
"""DurationField stores milliseconds rather than microseconds."""
value = super().adapt_durationfield_value(value)
if value is not None:
value //= 1000
# Store value as Int64 (long).
value = Int64(value)
return value

def adapt_integerfield_value(self, value, internal_type):
"""Store non-SmallIntegerField variants as Int64 (long)."""
if value is None:
Expand Down
Loading