Exemplo n.º 1
0
 def present_minimal(self, relations=False):
     data = SerializerMixin.serialize(self, "Person", relations=relations)
     return {
         "id": data["id"],
         "first_name": data["first_name"],
         "last_name": data["last_name"],
         "full_name": self.full_name()
     }
Exemplo n.º 2
0
 def present_minimal(self, relations=False):
     data = SerializerMixin.serialize(self, "Person", relations=relations)
     return {
         "id": data["id"],
         "first_name": data["first_name"],
         "last_name": data["last_name"],
         "full_name": self.full_name(),
         "has_avatar": data["has_avatar"],
         "active": data["active"],
         "desktop_login": data["desktop_login"]
     }
Exemplo n.º 3
0
 def present_minimal(self, relations=False):
     data = SerializerMixin.serialize(self, "Person", relations=relations)
     return {
         "id": data["id"],
         "first_name": data["first_name"],
         "last_name": data["last_name"],
         "full_name": self.full_name(),
         "has_avatar": data["has_avatar"],
         "active": data["active"],
         "departments": data.get("departments", []),
         "role": data["role"],
     }
Exemplo n.º 4
0
 def serialize_safe(self, relations=False):
     data = SerializerMixin.serialize(self, "Person", relations=relations)
     data["full_name"] = self.full_name()
     del data["password"]
     return data
Exemplo n.º 5
0
 def serialize(self, obj_type="Person", relations=False):
     data = SerializerMixin.serialize(self, "Person", relations=relations)
     data["full_name"] = self.full_name()
     return data
Exemplo n.º 6
0
 def serialize_safe(self):
     data = SerializerMixin.serialize(self, "Person")
     del data["password"]
     return data
Exemplo n.º 7
0
 def serialize_safe(self):
     data = SerializerMixin.serialize(self, "Person")
     data["full_name"] = self.full_name()
     del data["password"]
     return data
Exemplo n.º 8
0
 def serialize(self, obj_type="Person"):
     data = SerializerMixin.serialize(self, "Person")
     data["full_name"] = self.full_name()
     return data
Exemplo n.º 9
0
 def serialize_safe(self):
     data = SerializerMixin.serialize(self, "Contact")
     data["full_name"] = self.full_name()
     return data