コード例 #1
0
ファイル: account.py プロジェクト: topdev225/OverWrite
    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
コード例 #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
コード例 #3
0
 def to_dict(self):
     result = SAFRSBase.to_dict(self)
     result["custom_field"] = "some customization"
     return result