Skip to content

Instantly share code, notes, and snippets.

@zehpatricio
Created March 30, 2022 19:45
Show Gist options
  • Save zehpatricio/f7e88f57b37a32d3cf18849dede6f71b to your computer and use it in GitHub Desktop.
Save zehpatricio/f7e88f57b37a32d3cf18849dede6f71b to your computer and use it in GitHub Desktop.
from app.domain import model as domain_model
from app.adapter.rest import model as rest_model
def to_domain_model(location: rest_model.Location) -> domain_model.Location:
domain_location = domain_model.Location(**vars(location))
return domain_location
def to_rest_model(location: domain_model.Location) -> rest_model.Location:
rest_location = rest_model.Location(**vars(location))
return rest_location
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment