donor¶
A donor.
-
class
eldonationtracker.donor.
Donor
(json)¶ Bases:
object
Donor Attributes.
Class exists to provide attributes for a donor based on what comes in from the JSON so that it doesn’t have to be traversed each time a donor action needs to be taken.
- Parameters
json (json) – JSON attributes from the API
name (str) – donor’s name if provided, else Anonymous
donor_id (str) – the ID assigned by the API (currently not used)
image_url (str) – the URL for the donor’s avatar (currently not used)
amount – the sum of all donations the donor has made this campaign number_of_dononations: the number of donations the donor has made this campaign
-
json_to_attributes
(json)¶ Convert API JSON values to Donor attributes.
May be overwritten by child classes.
- Parameters
json (json) – JSON attributes from the API