The most important object in the Gratipay object model is Participant, and the second most important one is Ccommunity. There are a few others, but those are the most important two. Participant, in particular, is at the center of everything on Gratipay.

class gratipay.models.GratipayDB(url, minconn=1, maxconn=10, cursor_factory=<class 'postgres.cursors.SimpleNamedTupleCursor'>)[source]

Model the Gratipay database.


Runs all available self checks on the given cursor.

gratipay.models.add_event(c, type, payload)[source]

Log an event.

This is the function we use to capture interesting events that happen across the system in one place, the events table.

  • c – a Postres or Cursor instance
  • type (unicode) – an indicator of what type of event it is–either participant, team or payday
  • payload – an arbitrary JSON-serializable data structure; for participant type, id must be the id of the participant in question