Skip to content

[5.1.x] Backports for 5.1.0b4 release #349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: 5.1.x
Choose a base branch
from
Open
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
13 changes: 1 addition & 12 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,5 @@ jobs:
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Get zizmor
run: cargo install zizmor
- name: Run zizmor
run: zizmor --format sarif . > results.sarif
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
category: zizmor
uses: zizmorcore/zizmor-action@1c7106082dbc1753372e3924b7da1b9417011a21
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__ = "5.1.0b4.dev0"
__version__ = "5.1.0b4"

# Check Django compatibility before other imports which may fail if the
# wrong version of Django is installed.
Expand Down
216 changes: 0 additions & 216 deletions django_mongodb_backend/cache.py

This file was deleted.

1 change: 0 additions & 1 deletion django_mongodb_backend/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ def execute_sql(
else:
return self._make_result(obj, self.columns)
# result_type is MULTI
cursor.batch_size(chunk_size)
result = self.cursor_iter(cursor, chunk_size, self.columns)
if not chunked_fetch:
# If using non-chunked reads, read data into memory.
Expand Down
13 changes: 0 additions & 13 deletions django_mongodb_backend/creation.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
from django.conf import settings
from django.db.backends.base.creation import BaseDatabaseCreation

from django_mongodb_backend.management.commands.createcachecollection import (
Command as CreateCacheCollection,
)


class DatabaseCreation(BaseDatabaseCreation):
def _execute_create_test_db(self, cursor, parameters, keepdb=False):
Expand All @@ -20,12 +16,3 @@ def _destroy_test_db(self, test_database_name, verbosity):
for collection in self.connection.introspection.table_names():
if not collection.startswith("system."):
self.connection.database.drop_collection(collection)

def create_test_db(self, *args, **kwargs):
test_database_name = super().create_test_db(*args, **kwargs)
# Not using call_command() avoids the requirement to put
# "django_mongodb_backend" in INSTALLED_APPS.
CreateCacheCollection().handle(
database=self.connection.alias, verbosity=kwargs["verbosity"]
)
return test_database_name
5 changes: 4 additions & 1 deletion django_mongodb_backend/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ def trunc(self, compiler, connection):
return {"$dateTrunc": lhs_mql}


_trunc_convert_value = TruncBase.convert_value


def trunc_convert_value(self, value, expression, connection):
if connection.vendor == "mongodb":
# A custom TruncBase.convert_value() for MongoDB.
Expand All @@ -223,7 +226,7 @@ def trunc_convert_value(self, value, expression, connection):
# Truncate for Trunc(..., output_field=TimeField)
value = value.time()
return value
return self.convert_value(value, expression, connection)
return _trunc_convert_value(self, value, expression, connection)


def trunc_date(self, compiler, connection):
Expand Down
Empty file.
Empty file.

This file was deleted.

2 changes: 2 additions & 0 deletions django_mongodb_backend/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def adapt_timefield_value(self, value):
def _get_arrayfield_converter(self, converter, *args, **kwargs):
# Return a database converter that can be applied to a list of values.
def convert_value(value, expression, connection):
if value is None:
return None
return [converter(x, expression, connection) for x in value]

return convert_value
Expand Down
5 changes: 0 additions & 5 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ Forms

- :doc:`ref/forms`

Core functionalities
====================

- :doc:`topics/cache`

Miscellaneous
=============

Expand Down
28 changes: 0 additions & 28 deletions docs/source/ref/django-admin.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/source/ref/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ API reference

models/index
forms
django-admin
utils
Loading