django-fixture-magic icon indicating copy to clipboard operation
django-fixture-magic copied to clipboard

Could not dump objects until I modified dump_object.py as per comment

Open chr15m opened this issue 4 years ago • 1 comments

Everything I tried would yield the following error, even on internal Django models:

CommandError: object_class must be provided in the following format: app_name.model_name
Try calling dump_object with --help argument or use the following arguments:
 <[--kitchensink | -k] [--natural] [--query] object_class id [id ...]>

Then I tried the fix from this comment on closed issue #45 and after that I was able to dump objects successfully.

I don't understand what that args line is doing. I could submit a PR removing it but it would be good to know why it is there first.

Django version is 1.9.1.

chr15m avatar Jun 09 '20 12:06 chr15m

For anyone else who runs into this or #45, a workaround is to use JSON id lookups instead of ID. E.g. --query '{"pk__in": [1]}'.

chr15m avatar Jul 28 '20 08:07 chr15m