# -*- encoding: UTF-8 -*-

import hashlib
import os


def get_md5_path(self):
    md5 = hashlib.md5(self.user_profile.documento).hexdigest()[0:2]
    return "cvn/%s/" % md5


def get_cvn_path(self, filename):
    return os.path.join(
        get_md5_path(self), self.user_profile.documento, filename)

@@ -51,128 +51,479 @@
 s%0A%0A%0A
-def get_md5_path(self):%0A    md5 = hashlib.md5(self.user_profile.documento).hexdigest()%5B0:2%5D%0A    return %22cvn/%25s/%22 %25 md5%0A%0A
+# Do not touch. Uses self so it can be called in a django upload_to field%0A# https://stackoverflow.com/questions/17539720/django-model-with-filefield-dynamic-upload-to-argument%0Adef get_md5_path(self):%0A    md5 = hashlib.md5(self.user_profile.documento).hexdigest()%5B0:2%5D%0A    return %22cvn/%25s/%22 %25 md5%0A%0A# Do not touch. Uses self so it can be called in a django upload_to field%0A# https://stackoverflow.com/questions/17539720/django-model-with-filefield-dynamic-upload-to-argument
 %0Adef

Add comments