Various work on services api and models

This commit is contained in:
2010-02-25 11:34:30 +00:00
committed by dreddit
parent b6168ae824
commit 4cd4865f32
7 changed files with 125 additions and 10 deletions

View File

@@ -1,4 +1,16 @@
def get_api(api):
try:
mod = __import__(self.service.api)
except ImportError:
raise DoesNotExist('Error creating service')
for i in self.service.api.spit(".")[1:]:
mod = getattr(mod, i)
return getattr(mod, mod.ServiceClass)()
class BaseService():
"""
Base Service class, all service classes should inherit from this