Skip to content

Instantly share code, notes, and snippets.

@JT5D
Forked from sehmaschine/gist:1221774
Created November 8, 2013 14:20
Show Gist options
  • Select an option

  • Save JT5D/7371676 to your computer and use it in GitHub Desktop.

Select an option

Save JT5D/7371676 to your computer and use it in GitHub Desktop.
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