[Openstack] Database stuff
Aaron Lee
aaron.lee at RACKSPACE.COM
Tue Nov 29 20:20:12 UTC 2011
On Nov 29, 2011, at 11:55 AM, Vishvananda Ishaya wrote:
… some stuff I agree with, then...
> something like db.interfaces_get_by_instance(id, hint='fixed_ip'),
This is very similar to ActiveRecord. In a case like this you would say
Instance.find(id, :include => :fixed_ip)
If you are including the hint, why not just populate those models in the initial query?
Something like
db.instances_by_id_including_fixed_ips(id)
or
db.instances_by_id_including_vifs(id)
or whatever.
Aaron Lee
More information about the Openstack
mailing list