5 Commits

Author SHA1 Message Date
Dan Smith
f407b79ae2 Clean up duplicated change-building code in objects
Almost every object thus far has done this:

  changes = {}
  for key in self.obj_what_changed():
      changes[key] = self[key]

to get a dict of updates to apply to the database. This patch adds
that as part of the base object and makes every place that does
the above to just use that.

Change-Id: I847f5d35181b0305668b107f86faa164e71c3375
2013-09-09 14:45:09 -07:00
Jenkins
5335937a04 Merge "Create mixin class for common DB fields" 2013-09-05 22:57:54 +00:00
Dan Smith
55f007be2c Generalize the _make_list() function for objects
Each object with a list duplicated the _make_list() method in its
own module. This removes that duplication and adds a generalized
helper in objects/base.py. The instance object still uses its own
because it has to do a bunch of other stuff in the loop for
efficiency.

Change-Id: Ic910f39087ebc167b2b930979f7951116caf8598
2013-09-04 14:27:11 -07:00
Chris Behrens
60507b90b9 Create mixin class for common DB fields
Creates a new DBObjectMixin class for DB-backed objects to use.  This
allows us to create non-DB-backed objects without having the common DB
fields automagically added to them.

Related to blueprint unified-object-model

Change-Id: Iaf2d8500505e9acdbffffb1d4bd3db0870ae82a3
2013-09-04 17:37:48 +00:00
Dan Smith
03b6412afb Add Aggregate object model
This adds an Aggregate object model implementation.

Related to blueprint compute-api-objects

Change-Id: Ic947718766181f8262fcf171b2bc0c329e0ae8f9
2013-09-03 13:03:38 -07:00