Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from model_service import Service
- from model_company import Company
- class Portal(object):
- @staticmethod
- def create_service(service_name):
- #there is logic of getting service guid from plugin datatbase
- plugin = None #Plugin.get(name=service_name)
- param = {
- "name": service_name,
- "guid": plugin.guid,
- "version": plugin.version,
- "company_company_id": None, #connect to the company will be later
- }
- new_service = Service(**param)
- return new_service
- @staticmethod
- def create_company(company_name):
- current_user = None #implement it in future i want to ovveride Proadmin current user that get our account
- param = {
- "name": company_name,
- "description": "",
- "pis_code": "",
- "post_code": "",
- "address": "",
- "color": "",
- "town": "",
- "email": "",
- "contact_name": "",
- "account_account_id": current_user.id
- }
- new_company = Company(**param)
- return new_company
- @staticmethod
- def get_service(service_name):
- service = Service.get(name=service_name)
- return service
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement