-
Notifications
You must be signed in to change notification settings - Fork 205
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
Add schema generation support for plain GeometryFields #259
Add schema generation support for plain GeometryFields #259
Conversation
Fairly simple change, but looking for some feedback on the best way to write a test for this. |
serializer = inspector.get_serializer(path, method) | ||
content = inspector.map_serializer(serializer) | ||
|
||
print(content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we compare content
against the expected value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely haha. That's my bad, I had uncommitted changes before pushign
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one small change. Everything else is looking good to me. 👍🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the failing tests please
7735af3
to
a396ca8
Compare
I believe I've resolved all the issues. Fwiw, the |
…#257 The intial implementation of schema generation only supported serializers which subclassed GeoFeatureModel*Serializer. This meant that models which have standalone GeometryFields would not properly generate a schema. This change adds support for that use case. Closes openwisp#257
a396ca8
to
99ee740
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On question, do we need to update anything in the docs or is this just a pure bugfix?
I'd say it's a pure bug fix. The documentation says that schema generation is supported, but it was only working for a specific case. This change ensures that schema generation works for all field types. |
The test failures seem related to some DB setup, not anything to do with this change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@dhaval-mehta @auvipy any idea why this failure? "database connection isn't set to UTC". Looks a psycopg issue to me, most probably is happening in master as well.
Yes. psycopg/psycopg2#1293 |
The intial implementation of schema generation only supported
serializers which subclassed GeoFeatureModel*Serializer. This meant that
models which have standalone GeometryFields would not properly generate
a schema. This change adds support for that use case.
Fixes #257