Skip to content

Commit

Permalink
Merge branch 'main' into release-4
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhegarty committed Apr 11, 2024
2 parents f97d49f + b86c60c commit 452847a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/bulk_import.rst
Expand Up @@ -31,9 +31,9 @@ Caveats
* In bulk mode, exceptions are not linked to a row. Any exceptions raised by bulk operations are logged and returned
as critical (non-validation) errors (and re-raised if ``raise_errors`` is true).

* If you use :class:`~import_export.widgets.ForeignKeyWidget` then this can affect performance, because it reads from
the database for each row. If this is an issue then create a subclass which caches ``get_queryset()`` results rather
than reading for each invocation.
* If you use :class:`~import_export.widgets.ForeignKeyWidget` then this should not affect performance during lookups,
because the ``QuerySet`` cache should be used. Some more information
`here <https://stackoverflow.com/a/78309357/39296>`_.

* If there is the potential for concurrent writes to a table during a bulk operation, then you need to consider the
potential impact of this. Refer to :ref:`concurrent-writes` for more information.
Expand Down
16 changes: 16 additions & 0 deletions docs/testing.rst
Expand Up @@ -64,4 +64,20 @@ You can then run the script as follows:
# pass 'create', 'update' or 'delete' to run the single test
./manage.py runscript bulk_import --script-args create
Enable logging
^^^^^^^^^^^^^^

You can see console debug logging by updating the ``LOGGING`` block in `settings.py`::

LOGGING = {
"version": 1,
"handlers": {"console": {"class": "logging.StreamHandler"}},
"root": {
"handlers": ["console"],
},
"loggers": {
"django.db.backends": {"level": "DEBUG", "handlers": ["console"]},
}
}


0 comments on commit 452847a

Please sign in to comment.