-def get_images_from_folder(folder):
- return sorted(settings.MEDIA_URL + settings.IMAGE_DIR + u'/' + folder + u'/' + fn.decode('utf-8') for fn
- in os.listdir(os.path.join(settings.MEDIA_ROOT, settings.IMAGE_DIR, folder))
- if not fn.decode('utf-8').startswith('.'))
+# Yes, this is intentionally unnormalized !
+class GalleryForDocument(models.Model):
+ name = models.CharField(max_length=100)
+
+ # directory containing scans under MEDIA_ROOT/
+ subpath = models.CharField(max_length=255)