It is possible to manually re-attach the upload_to function like this:
mf._meta.get_field('content').generate_filename = path_maker
The resulting code looks like this:
def path_maker(m_file, filename):
ext = str(os.path.splitext(filename)[1])
return os.path.join('m_files', m_file.hash) + ext
...
def forwards(self, orm):
for mf in orm.ManagedFile.objects.all():
mf._meta.get_field('content').generate_filename = path_maker
print mf.content.path
oldpath = mf.content.path
cf = ContentFile(mf.content.read())
cf.name = oldpath
mf.content = cf
mf.save()