-
Notifications
You must be signed in to change notification settings - Fork 28
Description
I'm working on filling out @aepton's implementation of the Campaign Finance enhancement proposal, and I've uncovered an issue @jamesturk might need to consider sooner rather than later.
In the campaign finance OCDEP, Committee is described as a "Subclass of Popolo Organization", and adds a couple of attributes not expected on the base class. The existing OCD Organization class is a non-abstract model, and my understanding is that, as a general rule, we don't want to subclass non-abstract models.
This is similar to the Event/Election situation we got into previously. The solution then was to partially copy the definition of the Event model and create a new Election model. We also copied the definitions of the EventIdentifier and EventSource models to make new ElectionIdentifier and ElectionSource models.
I'm following this same approach for Committee and it's related models, but a few things give me pause:
- Whereas,
Eventwas in thelegislativemodule and was tailored to those use cases,Organizationis in thecoremodule and is defined rather generically. Organizationhas a couple of other related model thatCommitteealso needs:OrganizationIdentifierfor storing alternate ids for the campaign finance committeeOrganizationNamefor storing the committee's various different namesMembershipandPostfor storing relationships committees and their treasurers, officers, staff, etc.- Maybe also
OrganizationSourceandOrganizationContactDetails
- In the campaign finance spec, each
Transactionhas a.senderand.recipienteach of which will have either a.personor.organizationattribute populated, depending on the entity type. Under the current pattern, I think we also need a.committeeattribute, since these can also send and receive transactions. - While I don't foresee the need to represent an election as any other OCD data type, I can foresee needing to represent a single organization as a campaign finance committee as well as other types of organizations (e.g., political parties).
If 4 is a real need, then it feels like exactly what Django's multi-table inheritance was designed for. Even if it isn't, multi-table inheritance would also address the issues raised in 2 and 3.