Skip to content

Instantly share code, notes, and snippets.

@eculver
Created October 15, 2013 21:45
Show Gist options
  • Save eculver/6999168 to your computer and use it in GitHub Desktop.
Save eculver/6999168 to your computer and use it in GitHub Desktop.
def get_meta_property(self, name):
if not self.has_property(name):
msg = "Invalid metadata field '{0}'".format(name)
raise InvalidMetadataField(msg)
try:
value_obj = self.meta_values.get(category__name=name)
except NodeMetadataValue.DoesNotExist:
return None
return value_obj.value
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment