def insert_import(entity: Entity, location: Entity, project: Project, easting: float, northing: float) -> None: Db.insert_import({ 'entity_id': location.id, 'description': f"Imported centerpoint of {sanitize(entity.name, 'text')} " f"from the {sanitize(project.name, 'text')} project", 'geojson': f'{{"type":"Point", "coordinates": [{easting},{northing}]}}' })
def insert_import(entity: Entity, location: Entity, project: Project, easting: float, northing: float) -> None: Db.insert_import({ 'entity_id': location.id, 'description': 'Imported centerpoint of {name} from the {project} project'.format( name=sanitize(entity.name, 'text'), project=sanitize(project.name, 'text')), 'geojson': '''{{"type":"Point", "coordinates": [{easting},{northing}]}}'''.format( easting=easting, northing=northing)})