Esempio n. 1
0
    def to_dict(self):
        """Serialize this class into a SAFRS-compatible dictionary.

        Notes
        -----
        This is where we expose additional fields that are either 1) not in the model or 2) not
        automatically put in the model by SAFRS because it does not work with custom properties.
        """
        result = SAFRSBase.to_dict(self)
        result.update({"campaign_id": self.campaign_id, "password": None})

        return result
Esempio n. 2
0
    def to_dict(self):
        """Serialize this class into a SAFRS-compatible dictionary.

        Notes
        -----
        This is where we expose additional fields that are either 1) not in the model or 2) not
        automatically put in the model by SAFRS because it does not work with custom properties.
        """
        result = SAFRSBase.to_dict(self)
        result.update({
            "price": self.price,
            "sku": self.sku,
            "total": self.total
        })

        return result
Esempio n. 3
0
 def to_dict(self):
     result = SAFRSBase.to_dict(self)
     result["custom_field"] = "some customization"
     return result