Skip to content

Instantly share code, notes, and snippets.

@ianjosephwilson
Last active December 9, 2021 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianjosephwilson/ed8384661f3e3ec25164b98244ed50ee to your computer and use it in GitHub Desktop.
Save ianjosephwilson/ed8384661f3e3ec25164b98244ed50ee to your computer and use it in GitHub Desktop.
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