Open Eraldo opened 4 years ago
For your use-case, I believe this can also work.
re.sub("([a-z]+)(([A-Z][0-9])*)", r"\1_\2", name)
For your use-case, I believe this can also work.
re.sub("([a-z]+)(([A-Z][0-9])*)", r"\1_\2", name)
Thanks @abhushansahu for the comment.
This adds an underscore before each digit. E.g.:
In [6]: re.sub(r'(.*)(\d+)$', r"\1_\2", "http2Module1").lower()
Out[6]: 'http2module_1'
In [7]: re.sub("([a-z]+)(([A-Z][0-9])*)", r"\1_\2", "http2Module1").lower()
Out[7]: 'http_2module_1'
Being able to convert objects/properties back and forth between server and client. Also useful for introspecting and debugging use cases.
In my particular case, I receive an object on my server that the client got from the api and I want to associate it with the source which I now need an extra mapping for since the conversion is one-directional.
Version: graphene-django 2.10.0
This is where in graphene it is happening: https://github.com/graphql-python/graphene/issues/1204
My current workaround is to add an underscore in case of trailing numbers:
I have 2 solution suggestions:
_1
).