Skip to content

Opportunities to reduce duplication #23

Open
@jamstooks

Description

@jamstooks
  • 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])
    

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions