summaryrefslogtreecommitdiff
path: root/django/core/management/commands/loaddata.py
AgeCommit message (Collapse)Author
2024-05-10Fixed #35429 -- Added argparse choices to --database options.SaJH
2023-01-18Refs #34233 -- Used @functools.cache.Nick Pope
Python 3.9+ supports @functools.cache as an alias for @functools.lru_cache(maxsize=None).
2022-12-15Fixed #33308 -- Added support for psycopg version 3.Daniele Varrazzo
Thanks Simon Charette, Tim Graham, and Adam Johnson for reviews. Co-authored-by: Florian Apolloner <florian@apolloner.eu> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-08-23Fixed #33949 -- Fixed fixture dirs duplicates with Path instances.Claude Paroz
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-05-18Fixed #32317 -- Refactored loaddata command to make it extensible.William Schwartz
Moved deeply nested blocks out of inner loops to improve readability and maintainability. Thanks to Mariusz Felisiak, Shreyas Ravi, and Paolo Melchiorre for feedback.
2021-05-14Refs #32317 -- Simplified find_fixtures() in loaddata command.William Schwartz
This always replaces 'fixture_name' with its base name, which preserves the previous behavior, because os.path.basename() was not called only on relative paths without os.path.sep i.e. when base name was equal to the file name. This also changes os.path.dirname() and os.path.basename() calls to the equivalent os.path.split() call.
2021-05-14Refs #32317 -- Cleaned up try/except blocks in loaddata command.William Schwartz
This moves code unable to trigger relevant exceptions outside of try/except blocks, and changes 'objects' to 'objects_in_fixture' which is equal to the length of 'objects'.
2020-12-29Used model's Options.label where applicable.Mariusz Felisiak
Follow up to b7a3a6c9ef0a89625881b47594120bca55fa2e49.
2020-09-17Tweaked loaddata command to re-use a calculated value.Владимир Лысенко
Removed a dublicated call to get_public_serializer_formats which had already populated self.serialization_formats. Thanks to Nick Pope for review.
2020-05-15Fixed #31552 -- Added support for LZMA and XZ fixtures to loaddata.Paolo Melchiorre
2020-04-27Refs #18325 -- Removed unnecessary line endings in management commands.François Freitag
The OutputWrapper automatically adds \n when it’s not present.
2020-04-07Fixed #31428 -- Allowed empty message in management command self.stdout/err ↵François Freitag
proxies.
2019-04-25Removed redundant os.path.abspath() call.Jon Dufresne
2019-04-24Removed unnecessary assignments in various code.Jon Dufresne
2019-02-13Fixed #30184 -- Removed ellipsis characters from shell output strings.Dan Davis
Partially reverted 50b8493581fea3d7137dd8db33bac7008868d23a (refs #29654) to avoid a crash when the user shell doesn't support non-ASCII characters.
2018-09-26Fixed loaddata error message when uncompressed fixture has a dot in its name.Sergey Fedoseev
2018-09-25Removed unneeded list() calls in list.extend() argument.Sergey Fedoseev
2018-08-22Refs #29654 -- Replaced three dots with ellipsis character in output strings.Claude Paroz
2018-07-13Fixed #26291 -- Allowed loaddata to handle forward references in natural_key ↵Peter Inglesby
fixtures.
2018-07-02Removed parser.add_arguments() arguments that match the defaults.Claude Paroz
2017-12-30Fixed #28117 -- Added a helpful message in loaddata when psycopg2 can't load ↵Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి)
a fixture due to NUL characters.
2017-12-07Refs #23919 -- Replaced super() calls for old-style classes.Nick Pope
2017-11-06Fixed #28776 -- Fixed a/an/and typos in docs and comments.Дилян Палаузов
2017-06-01Refs #23968 -- Removed unnecessary lists, generators, and tuple calls.Jon Dufresne
2017-05-27Fixed #28249 -- Removed unnecessary dict.keys() calls.Jon Dufresne
iter(dict) is equivalent to iter(dict.keys()).
2017-05-26Fixed #27978 -- Allowed loaddata to read data from stdin.Pavel Kulikov
Thanks Squareweave for the django-loaddata-stdin project from which this is adapted.
2017-04-01Removed implicit default store_true/false argparse args.Jon Dufresne
argparse automatically sets the default value for store_true/false arguments to its opposite.
2017-03-04Refs #27795 -- Removed unneeded force_text callsClaude Paroz
Thanks Tim Graham for the review.
2017-02-21Refs #27656 -- Updated django.core docstring verbs according to PEP 257.Anton Samarchyan
2017-01-20Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.Tim Graham
These functions do nothing on Python 3.
2017-01-18Refs #23919 -- Stopped using django.utils.lru_cache().Aymeric Augustin
2017-01-18Refs #23919 -- Removed six.PY2/PY3 usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-06-09Fixed #20468 -- Added loaddata --exclude option.Berker Peksag
Thanks Alex Morozov for the initial patch.
2016-04-08Fixed E128 flake8 warnings in django/.Tim Graham
2016-03-05Refs #26315 -- Cleaned up argparse options in commands.Jon Dufresne
* Removed type coercion. Options created by argparse are already coerced to the correct type. * Removed fallback default values. Options created by argparse already have a default value. * Used direct indexing. Options created by argparse are always set. This eliminates the need to use dict.get().
2016-03-01Removed obsolete, unused option 'hide_empty' from loaddata command.Jon Dufresne
Unused since 67235fd4ef1b006fc9cdb2fa20e7bb93b0edff4b.
2016-01-04Fixed #21549 -- Made loaddata's 'fixture not found' warning an exception.Andrew Kuchev
Thanks to mpasternak for the report and Tim Graham for the review.
2015-12-31Fixed #23372 -- Made loaddata faster if it doesn't find any fixtures.Anssi Kääriäinen
Django's test suite often tries to load fixture files from apps that have no fixtures at all. This creates a lot of unnecessary disabling and enabling of constraints which can be expensive on some database. To speed this up, loaddata now first checks if any fixture file matches. If no fixture file is matched, then the command exits before disabling and enabling of constraints is done. The main benefit of this change is seen on MSSQL, where tests on Django 1.8 run hours faster.
2015-06-13Fixed #24978 -- Escaped special characters in loaddata fixture pathsMoritz Sichert
2015-04-16Fixed #21652 -- Added notification when processing objects in loaddataYitzhak Clark
Added a running count of the objects processed by loaddata when verbosity >= 3.
2015-02-20Fixed #24351, #24346 -- Changed the signature of allow_migrate().Loic Bistuer
The new signature enables better support for routing RunPython and RunSQL operations, especially w.r.t. reusable and third-party apps. This commit also takes advantage of the deprecation cycle for the old signature to remove the backward incompatibility introduced in #22583; RunPython and RunSQL won't call allow_migrate() when when the router has the old signature. Thanks Aymeric Augustin and Tim Graham for helping shape up the patch. Refs 22583.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-17Removed support for initial_data fixtures per deprecation timeline.Tim Graham
2014-10-31Fixed #23468 -- Added checks for duplicate fixtures directories in loaddata.Konrad Świat
If settings.FIXTURE_DIRS contains duplicates or a default fixture directory (app_name/fixtures), ImproperlyConfigured is raised. Thanks to Berker Peksag and Tim Graham for review.
2014-10-09Fixed #23612 -- Normalized fixuture paths to allow referencing relative ↵Brandon Taylor
paths on Windows.
2014-07-27Only warn about initial data if fixtures have been found.Florian Apolloner
2014-07-25Mark initial_data as deprecated separately from syncdb. Refs #23077.Andrew Godwin