Create a base model and generic serialization. #144
Merged
+179
−141
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@vincentsarago This is what I ended up doing based on #143
I realized all of the classes included BBox and the GeoInterfaceMixin, so combined it all in one new base.
I added a class variable
__exclude_if_none__
that is used to determine which fields are excluded. Not particularly invested in the name, was just what I came up with. Also considered starting it with__geojson_pydantic
to be a bit closer to some of the__pydantic
ones.Its getting late and my brain has quit on me. I think there were more tests I wanted to add but I will have to take another look in the morning.