Skip to content

Instantly share code, notes, and snippets.

@sehmaschine
Created September 16, 2011 10:23
Show Gist options
  • Save sehmaschine/1221774 to your computer and use it in GitHub Desktop.
Save sehmaschine/1221774 to your computer and use it in GitHub Desktop.
filebrowse-field: value needs to be a fileobject
if value != "":
try:
value = FileObject(url_to_path(value))
if value.is_version and VERSIONS_BASEDIR:
final_attrs['directory'] = os.path.split(value.original.path_relative)[0]
else:
final_attrs['directory'] = os.path.split(value.path_relative)[0]
except:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment