fietsboek.models.image module

Image metadata.

The actual image data is saved on disk, we only store the metadata such as an image description here.

class fietsboek.models.image.ImageMetadata(**kwargs)

Bases: Base

Represents metadata for an uploaded image.

Variables:
  • id (int) – Database ID.

  • track_id (int) – ID of the track that this image belongs to.

  • image_name (str) – Name of the image file.

  • description (str) – The description that should be shown.

  • track (fietsboek.models.track.Track) – The track that this image belongs to.

description
classmethod get_or_create(dbsession, track, image_name)

Retrieves the image metadata for the given image, or creates a new one if it doesn’t exist.

Parameters:
Returns:

The created/retrieved object.

Return type:

ImageMetadata

id
image_name
track: Mapped[Track]
track_id