Skip to content

Instantly share code, notes, and snippets.

@hub-cap
Created April 26, 2013 15:58
Show Gist options
  • Save hub-cap/5468353 to your computer and use it in GitHub Desktop.
Save hub-cap/5468353 to your computer and use it in GitHub Desktop.
class DatabaseModelBase(models.ModelBase):¬
_auto_generated_attrs = ['id']¬
_uuid_strategy = utils.generate_uuid¬
¬
@classmethod¬
def create(cls, **values):¬
if 'id' not in values and cls._uuid_strategy is not None:¬
values['id'] = uuid_strategy()¬
class Action(dbmodels.DatabaseModelBase):¬
"""Defines an Instance Action."""¬
¬
_data_fields = ['instance_uuid', 'updated_at', 'request_id', 'user_id',¬
'start_time', 'finish_time', 'message']¬
_table_name = 'actions'¬
_uuid_strategy = None¬
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment