mscarey / legislice

API client for fetching and comparing passages from legislation
https://legislice.readthedocs.io/
Other
8 stars 2 forks source link

use JSON input to create API call and then load with schema #5

Closed mscarey closed 4 years ago

mscarey commented 4 years ago

The JSON input normally won't have "content" or "heading" fields. The tool will need to determine whether fields are missing, create the right API call to fill in the blanks, and then load the object with the marshmallow schema.

Does the API call need to happen in a pre-load function in the serializer itself, to fit with the existing interface? If so that's horrible. If it needs to happen right after collect_enactments but before the serializer (modifying the contents of the EnactmentIndex), that's not quite as bad.

mscarey commented 4 years ago

Handled by enactment_needs_api_update and update_enactment_from_api