def as_dict(self): d = { to_camel_case(c.name): getattr(self, c.name) for c in self.__table__.columns } d["operators"] = self.operators return d
def as_dict(self): d = { to_camel_case(c.name): getattr(self, c.name) for c in self.__table__.columns } d["experiments"] = self.experiments return d
def as_dict(self): d = { to_camel_case(c.name): getattr(self, c.name) for c in self.__table__.columns } del d["tasks"] d["operators"] = [{"taskId": o} for i, o in enumerate(self.tasks)] return d
def as_dict(self): d = { to_camel_case(c.name): getattr(self, c.name) for c in self.__table__.columns } status = getattr(self, 'status', None) if status: d["status"] = status return d
def as_dict(self): d = { to_camel_case(c.name): getattr(self, c.name) for c in self.__table__.columns } return d
def test_to_camel_case(self): result = to_camel_case("foo_bar") self.assertEqual("fooBar", result)