Skip to content

Instantly share code, notes, and snippets.

@hub-cap
Last active December 16, 2015 17:10
Show Gist options
  • Save hub-cap/5468758 to your computer and use it in GitHub Desktop.
Save hub-cap/5468758 to your computer and use it in GitHub Desktop.
class DatabaseModelBase(models.ModelBase):¬
_auto_generated_attrs = ['id']¬
_uuid_strategy = uuidutils.generate_uuid¬
¬
@classmethod¬
def create(cls, **values):¬
print cls¬
print cls._uuid_strategy
print cls._uuid_strategy()
Printed output
<class 'reddwarf.instance.models.ServiceImage'>
<unbound method ServiceImage.generate_uuid>
And error
Run tests failed: unbound method generate_uuid() must be called with ServiceImage instance as first argument (got nothing instead)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment