Skip to content

Mapping: Appending to list, Adding to dictionary #143

Description

@josephfinlayson

I'm trying to map between two resources

class AirtableShopifyMapper(odin.Mapping):

    from_resource = AirTableProduct
    to_resource = ShopifyProduct

    @odin.map_list_field(from_field='wholesale_price', to_field='metafields')
    def wholesale_price(self, value):
        return ["wholesale_price"]

    
    @odin.map_list_field(from_field='sample_price', to_field='metafields')
    def sample_price (self, value):
        return ["sample_price"]

Specifically, I want to find out how to append to a field on the to_resource I can't work out how to do this. I've tried to access the to_object.metafields on self to keep appending, but I don't see it avaiable. Any tips?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementThis is a feature enhancementquestionThis issue is a Help Question

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions