Created
March 30, 2022 19:25
-
-
Save zehpatricio/2ca33732eb9f4089a9465761fb3de0da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from app.domain import model as domain_model | |
from app.adapter.db import model as sql_model | |
def to_domain_model(location: sql_model.Location) -> domain_model.Location: | |
domain_location = domain_model.Location( | |
id=location.id, | |
device_id=location.device_id, | |
lat=location.lat, | |
long=location.long, | |
date=location.date, | |
) | |
return domain_location | |
def to_sql_model(location: domain_model.Location) -> sql_model.Location: | |
sql_location = sql_model.Location( | |
id=location.id, | |
device_id=location.device_id, | |
lat=location.lat, | |
long=location.long, | |
date=location.date, | |
) | |
return sql_location |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment