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
How could I represent this yaml in a class? I've tried this:
@related.immutable
class Device(object):
name = related.StringField()
@related.immutable
class Settings(object):
devices = related.MappingField(Device, "name")
But it gives me an error: TypeError: 000123456789 is not an instance of <class '__main__.Device'>
I've tried using SetField, SequenceField and others in this case but to no success.
The text was updated successfully, but these errors were encountered:
is passed to the MappingField. So 'left-keyboard' will be used as the name and 000123456789 to whatever class is passed to the cls parameter of MappingField - in our example this is str.
Hi! I'm trying to use your library with a custom yaml file I have:
How could I represent this yaml in a class? I've tried this:
But it gives me an error:
TypeError: 000123456789 is not an instance of <class '__main__.Device'>
I've tried using
SetField
,SequenceField
and others in this case but to no success.The text was updated successfully, but these errors were encountered: