Changed Image model path to method.
This commit is contained in:
@@ -11,13 +11,17 @@ from django.db.models import (
|
||||
)
|
||||
|
||||
|
||||
def get_gallery_root():
|
||||
return settings.GALLERY_ROOT
|
||||
|
||||
|
||||
class Image(Model):
|
||||
"""
|
||||
User relations to a specific image file by path.
|
||||
"""
|
||||
|
||||
user = ForeignKey(settings.AUTH_USER_MODEL, blank=False, null=False, on_delete=CASCADE)
|
||||
path = FilePathField(path=settings.GALLERY_ROOT, blank=False, null=False)
|
||||
path = FilePathField(path=get_gallery_root, blank=False, null=False)
|
||||
favorite = BooleanField(blank=False, null=False, default=False)
|
||||
last_visited = DateTimeField(blank=False, null=False, default=timezone.now)
|
||||
visits = IntegerField(blank=False, null=False, default=0)
|
||||
|
||||
Reference in New Issue
Block a user