Rajaram/Vinkesh | Added ip_routes in ip_allocations' payload

This commit is contained in:
vinkesh banka
2011-09-29 15:16:32 +05:30
committed by Rajaram Mallya
parent 47e1853c67
commit 484ac4d30c
6 changed files with 172 additions and 20 deletions

View File

@@ -297,6 +297,9 @@ class IpBlock(ModelBase):
def policy(self):
return Policy.get(self.policy_id)
def ip_routes(self):
return IpRoute.find_all(source_block_id=self.id)
def get_address(self, address):
return IpAddress.get_by(ip_block_id=self.id, address=address)