Fix in imagefield
This commit is contained in:
parent
5459b598cb
commit
e010ec794c
1 changed files with 6 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ from pathlib import Path
|
|||
from paramecio.cromosoma.corefields import CharField
|
||||
from paramecio.cromosoma.extraforms.fileform import FileForm
|
||||
from paramecio.citoplasma import httputils
|
||||
from paramecio.citoplasma.keyutils import create_key
|
||||
import traceback
|
||||
|
||||
from bottle import request
|
||||
|
|
@ -33,6 +34,8 @@ class ImageField(CharField):
|
|||
|
||||
self.default_quality_thumb=95
|
||||
|
||||
self.suffix=''
|
||||
|
||||
# Is relative to media folder of paramecio
|
||||
|
||||
#if module!=None:
|
||||
|
|
@ -94,7 +97,7 @@ class ImageField(CharField):
|
|||
else:
|
||||
|
||||
value=os.path.basename(value)
|
||||
|
||||
|
||||
return self.save_folder+'/'+value
|
||||
|
||||
|
||||
|
|
@ -172,7 +175,8 @@ class ImageField(CharField):
|
|||
prefix=''
|
||||
|
||||
if self.yes_prefix==True:
|
||||
prefix=uuid4().hex+'_'
|
||||
#prefix=uuid4().hex+'_'
|
||||
prefix=create_key(5).replace('/', '-').replace('#', '-')+self.suffix+'_'
|
||||
|
||||
filename=prefix+filename
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue