Guest User

Untitled

a guest
Dec 10th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. def fix_dev_path():
  2. from filer.models import File
  3. import sys
  4. for f in File.objects.filter(is_public=True):
  5. sys.stdout.write(u'moving %s to public storage... ' % f.id)
  6. f.is_public = False
  7. f.file.name = "filer/%s" % f.file.name
  8. f.save()
  9. f.is_public = True
  10. f.save()
  11. sys.stdout.write(u'done\n')
  12. for f in File.objects.filter(is_public=False):
  13. sys.stdout.write(u'moving %s to private storage... ' % f.id)
  14. f.is_public = True
  15. f.file.name = "filer/%s" % f.file.name
  16. f.save()
  17. f.is_public = False
  18. f.save()
  19. sys.stdout.write(u'done\n')
Add Comment
Please, Sign In to add comment