Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opportunities to reduce duplication #23

Open
4 tasks
jamstooks opened this issue Apr 3, 2017 · 0 comments
Open
4 tasks

Opportunities to reduce duplication #23

jamstooks opened this issue Apr 3, 2017 · 0 comments

Comments

@jamstooks
Copy link
Contributor

jamstooks commented Apr 3, 2017

  • Add a BaseService class that defines the __init__ method. Maybe combine with ChunkQueryMixin...

  • Remove ms_object_to_model in favor of a modelKlass property on each service so ms_object_to_model can be defined in the BaseService and simply use self.modelKlass(sane_obj). This requires separate services for separate models, unlike the combined Org and OrgType ones now.

  • Clean up request_session() calls:

Move

    if not self.client.session_id:
        self.client.request_session()

into __init__ and out of access methods... ConciergeClient.__init__() or BaseService.__init__() as appropriate.

  • Add a shared method for query parameter handling to the BaseService for:

      if where_params:
          query += " WHERE "
          query += " AND ".join(
              ["%s %s %s" % (p[0], p[1], p[2]) for p in where_params])
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants