From 867d1db7373df4a85422e2461866c98ad362b711 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Fri, 30 Nov 2012 21:16:42 -0500 Subject: [PATCH] added set_allocations() and delete_allocations() --- sfa/storage/model.py | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/sfa/storage/model.py b/sfa/storage/model.py index 972040e6..e490251b 100644 --- a/sfa/storage/model.py +++ b/sfa/storage/model.py @@ -316,9 +316,11 @@ class SliverAllocation(Base,AlchemyObj): sliver_id = Column(String, primary_key=True) allocation_state = Column(String) - def __init__(self, sliver_id, allocation_state): - self.sliver_id = sliver_id - self.allocation_state = allocation_state + def __init__(self, **kwds): + if 'sliver_id' in kwds: + self.sliver_id = kwds['sliver_id'] + if 'allocation_state' in kwds: + self.allocation_state = kwds['allocation_state'] def __repr__(self): result = "