Created
April 26, 2013 15:58
-
-
Save hub-cap/5468353 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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