diff --git a/insuree/models.py b/insuree/models.py index b6c3870..1c8fa8c 100644 --- a/insuree/models.py +++ b/insuree/models.py @@ -1,3 +1,4 @@ +import os.path import uuid import core @@ -45,6 +46,11 @@ class InsureePhoto(core_models.VersionedModel): db_column='AuditUserID', blank=True, null=True) # rowid = models.TextField(db_column='RowID', blank=True, null=True) + def full_file_path(self): + if not InsureeConfig.insuree_photos_root_path or not self.filename: + return None + return os.path.join(InsureeConfig.insuree_photos_root_path, self.folder, self.filename) + class Meta: managed = False db_table = 'tblPhotos'