Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why require a Jurisdiction for each Event? #79

Closed
gordonje opened this issue Mar 16, 2017 · 11 comments
Closed

Why require a Jurisdiction for each Event? #79

gordonje opened this issue Mar 16, 2017 · 11 comments

Comments

@gordonje
Copy link
Contributor

The Event Django model currently has a jurisdiction foreign key field with a not null constraint. However, this field is not mentioned in the OCD Event format or in the Event OCDEP.

Assuming the typical use case is to model meetings of various public agencies (e.g., a state legislative committee or city council), couldn't that be handled via an Organization as an event participant?

@jamesturk
Copy link
Member

jamesturk commented Mar 16, 2017

I think the main reason is for scoping Events & deduplication. At present, I believe everyone using these models have a single DB that is multi-jurisdiction- as such there needs to be an easy way to separate Jurisdiction's organizations/events/etc.

https://github.com/opencivicdata/pupa/blob/master/pupa/importers/events.py#L40 is an example of where this is done, we consider the unique set of attributes for an Event to be {name,description,start,end,timezone,jurisdiction}

& because participants aren't stored on the Event object we can't easily use them like this

(for a single-jurisdiction instance Jurisdiction is likely to be an implementation detail that can be essentially ignored)

@fgregg
Copy link
Contributor

fgregg commented Mar 16, 2017

How about having an Event class without this attribute, and then having a LegislativeEvent subclass with this attribute that pupa would use?

@jamesturk
Copy link
Member

jamesturk commented Mar 16, 2017 via email

@fgregg
Copy link
Contributor

fgregg commented Mar 16, 2017

I don't think I understand your question. The LegislativeEvent would be the exact same thing as the current Event. The new Event would be compliant with the OCD spec and ready to be used for non pupa purposes where jurisdiction is not an appropriate scope.

@jamesturk
Copy link
Member

jamesturk commented Mar 16, 2017 via email

@jamesturk
Copy link
Member

jamesturk commented Mar 16, 2017 via email

@fgregg
Copy link
Contributor

fgregg commented Mar 16, 2017

Hmm.. interesting. Political campaigns organizations don't really have jurisdictions and we are going to want to model those. I can't think of a governmental organization that doesn't have a jurisdiction.

I think we will need to have a conversation of jurisdiction-less organizations, but that should probably happen on https://github.com/opencivicdata/docs.opencivicdata.org/, since the current OCD spec does require jurisdictions.

In any case, as you have said, the case for Events is different. We are not saying that Events truly have or are associated with jurisdictions, but we have used jurisdictions as convenient scoping mechanism.

@jamesturk
Copy link
Member

FWIW, I feel like Event missing Jurisdiction on docs.opencivicdata.org was an accident, not an intentional choice. If you had an Event that wasn't tied to a Jurisdiction how would you deduplicate it?

@fgregg
Copy link
Contributor

fgregg commented Mar 16, 2017

Well, the spec is the spec. We should go through OCDEP process either way.

Right now pupa uses name, description, start_time, end_time, timezone, and jurisdiction_id. I think if you added location and removed jurisdiction, you would have something just as deduplicable.

If that's not sufficient, we can create a subclass with an appropriate scoping value.

Also, for pupa, you can continue to use jurisdiction_id. You'll just use a subclass of an Event

@jamesturk
Copy link
Member

jamesturk commented Mar 16, 2017 via email

@gordonje
Copy link
Contributor Author

Conversation has moved here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants