Exemple #1
0
 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
Exemple #2
0
 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
Exemple #3
0
 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
Exemple #4
0
 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
Exemple #5
0
 def as_dict(self):
     d = {
         to_camel_case(c.name): getattr(self, c.name)
         for c in self.__table__.columns
     }
     return d
Exemple #6
0
 def test_to_camel_case(self):
     result = to_camel_case("foo_bar")
     self.assertEqual("fooBar", result)