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

dumpdata 'file' object has no attribute 'chunks' #9

Open
cy-goh opened this issue Jan 6, 2014 · 1 comment
Open

dumpdata 'file' object has no attribute 'chunks' #9

cy-goh opened this issue Jan 6, 2014 · 1 comment

Comments

@cy-goh
Copy link

cy-goh commented Jan 6, 2014

trying to loaddata gives me the following error:

Traceback (most recent call last):
  File "/Users/carrier24sg/.virtualenvs/pastacard/lib/python2.7/site-packages/django/core/management/base.py", line 222, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/carrier24sg/.virtualenvs/pastacard/lib/python2.7/site-packages/django/core/management/base.py", line 255, in execute
    output = self.handle(*args, **options)
  File "/Users/carrier24sg/.virtualenvs/pastacard/lib/python2.7/site-packages/fixturemedia/management/commands/loaddata.py", line 51, in handle
    return super(Command, self).handle(*fixture_labels, **options)
  File "/Users/carrier24sg/.virtualenvs/pastacard/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 193, in handle
    obj.save(using=using)
  File "/Users/carrier24sg/.virtualenvs/pastacard/lib/python2.7/site-packages/django/core/serializers/base.py", line 165, in save
    models.Model.save_base(self.object, using=using, raw=True)
  File "/Users/carrier24sg/.virtualenvs/pastacard/lib/python2.7/site-packages/django/db/models/base.py", line 570, in save_base
    update_fields=update_fields)
  File "/Users/carrier24sg/.virtualenvs/pastacard/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 170, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/Users/carrier24sg/.virtualenvs/pastacard/lib/python2.7/site-packages/fixturemedia/management/commands/loaddata.py", line 36, in load_images_for_signal
    default_storage.save(path.name, f)
  File "/Users/carrier24sg/.virtualenvs/pastacard/lib/python2.7/site-packages/django/core/files/storage.py", line 48, in save
    name = self._save(name, content)
  File "/Users/carrier24sg/.virtualenvs/pastacard/lib/python2.7/site-packages/django/core/files/storage.py", line 202, in _save
    for chunk in content.chunks():
AttributeError: Problem installing fixture 'pastacard/fixtures/mediadump.json': 'file' object has no attribute 'chunks'
@cy-goh
Copy link
Author

cy-goh commented Jan 6, 2014

I believe it should be default_storage.save(path.name, open(django.core.files.File(f)))

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

1 participant