Skip to content

Instantly share code, notes, and snippets.

@ianjosephwilson
Last active Dec 9, 2021
Embed
What would you like to do?
mapper_reg.map_imperatively(
AlbumImage,
album_images_t,
properties={
"album": relationship(
Album, backref=backref("images", order_by=album_images_t.c.display_order)
),
"image": relationship(Image, backref="album_images"),
},
)
ai = AlbumImage(
#album=album,
display_order=index,
image=album_image_dict["image"],
caption=album_image_dict["caption"],
)
album.images.append(ai)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment