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

  • self.name – donor’s name if provided, else Anonymous

  • self.donor_id – the ID assigned by the API (currently not used)

  • self.image_url – the URL for the donor’s avatar (currently not used)

  • self.amount – the sum of all donations the donor has made this campaign

  • self.number_of_donations – 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