You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ResourceInstanceDataType class supports this kind of value for importing from, for example, csv:
deftransform_value_for_tile(self, value, **kwargs):
try:
returnjson.loads(value)
exceptValueError:
# do this if json (invalid) is formatted with single quotes, re #6390try:
returnast.literal_eval(value)
except:
returnvalueexceptTypeError:
# data should come in as json but python list is accepted as wellifisinstance(value, list):
returnvalue
This datatype already considers data valid if it only contains a value for "resoruceId" and nothing else. It would be nice if a user could import a value that only contained a resourceId uuid string and then the datatype method populates the rest of the boilerplate with empty string values.
The text was updated successfully, but these errors were encountered:
Funny, I just hacked out a version of this in #11596 (not that it's factored perfectly), and I'd definitely be up to pull it out into its own PR or collab on your implementation. Say the word.
I'm hacking out a proof of concept right now to import either a single uuid string or a list of uuid strings from a csv cell. I'd be happy to push to a branch to see if there's a collab that makes sense
My hack also took a list of python UUID types (not strings), but doesn't handle a jumbled array of some-of-one-and-some-of-the-other, which would be easy to handle if factored well. Happy to review!
The ResourceInstanceDataType class supports this kind of value for importing from, for example, csv:
Meaning that each value has to look like this:
This datatype already considers data valid if it only contains a value for
"resoruceId"
and nothing else. It would be nice if a user could import a value that only contained a resourceId uuid string and then the datatype method populates the rest of the boilerplate with empty string values.The text was updated successfully, but these errors were encountered: