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:
dbsession (sqlalchemy.orm.session.Session) – The database session.
track (fietsboek.models.track.Track) – The track.
image_name (str) – The name of the image.
- Returns:
The created/retrieved object.
- Return type:
- id¶
- image_name¶
- track_id¶