Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fix_dev_path():
- from filer.models import File
- import sys
- for f in File.objects.filter(is_public=True):
- sys.stdout.write(u'moving %s to public storage... ' % f.id)
- f.is_public = False
- f.file.name = "filer/%s" % f.file.name
- f.save()
- f.is_public = True
- f.save()
- sys.stdout.write(u'done\n')
- for f in File.objects.filter(is_public=False):
- sys.stdout.write(u'moving %s to private storage... ' % f.id)
- f.is_public = True
- f.file.name = "filer/%s" % f.file.name
- f.save()
- f.is_public = False
- f.save()
- sys.stdout.write(u'done\n')
Add Comment
Please, Sign In to add comment