I am using Python 2.7.2 and SQLAlchemy 0.9.3. A Department has many groups.
class Department(Base):
id = Column(Integer, primary_key=True)
groups = relationship("Group", backref="department")
...
class Group(Base):
id = Column(Integer, primary_key=True)
department_id = Column(Integer, ForeignKey('departments.id'))
...
Where do get_groups and add_group methods belong? In DepartmentService or GroupService?
class DepartmentService(object):
def get_groups(self, dept_id):
...
def add_group(self, dept_id, group):
...
class GroupService(object):
def get_groups(self, dept_id):
...
def add_group(self, dept_id, group):
...
Or do I call the GroupService from DepartmentService ?