Change from_db_model to create the correct uri

Change-Id: Idbf61639854029b6d5003f58baaae171c0b3a817
Closes-Bug: #1285017
This commit is contained in:
Julien Vey
2014-02-26 14:10:48 +01:00
parent 230eb5fe8d
commit d68c043055
7 changed files with 8 additions and 3 deletions

View File

@@ -46,7 +46,7 @@ class Base(wtypes.Base):
def from_db_model(cls, m, host_url):
json = m.as_dict()
json['type'] = m.__tablename__
json['uri'] = '%s/v1/%s/%s' % (host_url, json['type'], m.uuid)
json['uri'] = '%s/v1/%s/%s' % (host_url, m.__resource__, m.uuid)
del json['id']
return cls(**(json))