Skip to content
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

Need to reopen issue 887 #1504

Closed
greyhare opened this issue Oct 23, 2024 · 2 comments
Closed

Need to reopen issue 887 #1504

greyhare opened this issue Oct 23, 2024 · 2 comments

Comments

@greyhare
Copy link

I don't have permission to reopen issue 887. TL;DR: dumpdata emits the filer_image table in place of the filer_file table, resulting in a fixture with no files, duplicated images, and integrity errors when fed to loaddata.

Also I can't figure out which of the 4000+ contributors are the maintainers so I could @ them instead of making a new issue. Sorry.

@fsbraun
Copy link
Member

fsbraun commented Oct 23, 2024

For me (Django 4.2 and 5.0) dumping and loading fixtures works: first the filer.file table is exported and then filer.image:

[
    {"model": "filer.file", "pk": 1, "fields": {"polymorphic_ctype": 56, "folder": null, "file": "filer_public/.../bla.jpg", "_file_size": 84006, "sha1": "42000b08e6b9c1fb3f8533ba9b7884f7912ebbb3", "has_all_mandatory_data": false, "original_filename": "bla.jpg", "name": "", "description": "", "owner": 1, "uploaded_at": "2024-09-23T17:08:17.704Z", "modified_at": "2024-09-23T17:08:40.285Z", "is_public": true, "mime_type": "image/jpeg"}}, 
    {"model": "filer.clipboard", "pk": 1, "fields": {"user": 1}}, 
    {"model": "filer.image", "pk": 1, "fields": {"_height": 318.0, "_width": 502.0, "_transparent": false, "default_alt_text": null, "default_caption": null, "subject_location": "98,170", "date_taken": "2024-09-23T17:08:17.698Z", "author": null, "must_always_publish_author_credit": false, "must_always_publish_copyright": false}}
]

Be aware that dumpdata does not dump the files themselves, only filer's tables.

The next-gen django-filer will not use django-polymorphic any more (which was the root cause of the issue). Not sure what's going wrong on your side.

@greyhare Can you share a minimal dump for your case?

@greyhare
Copy link
Author

Yes, I'm aware that dumpdata doesn't dump the files (though there's a setting to serialize the files into base64 and stuff them in, but I didn't notice any difference in output). I'm trying to use fixtures to switch databases; the file store would carry over untouched in this case.

Anyway, I'll close here and continue in the original issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants