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.corefields import CharField
|
||||||
from paramecio.cromosoma.extraforms.fileform import FileForm
|
from paramecio.cromosoma.extraforms.fileform import FileForm
|
||||||
from paramecio.citoplasma import httputils
|
from paramecio.citoplasma import httputils
|
||||||
|
from paramecio.citoplasma.keyutils import create_key
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from bottle import request
|
from bottle import request
|
||||||
|
|
@ -33,6 +34,8 @@ class ImageField(CharField):
|
||||||
|
|
||||||
self.default_quality_thumb=95
|
self.default_quality_thumb=95
|
||||||
|
|
||||||
|
self.suffix=''
|
||||||
|
|
||||||
# Is relative to media folder of paramecio
|
# Is relative to media folder of paramecio
|
||||||
|
|
||||||
#if module!=None:
|
#if module!=None:
|
||||||
|
|
@ -172,7 +175,8 @@ class ImageField(CharField):
|
||||||
prefix=''
|
prefix=''
|
||||||
|
|
||||||
if self.yes_prefix==True:
|
if self.yes_prefix==True:
|
||||||
prefix=uuid4().hex+'_'
|
#prefix=uuid4().hex+'_'
|
||||||
|
prefix=create_key(5).replace('/', '-').replace('#', '-')+self.suffix+'_'
|
||||||
|
|
||||||
filename=prefix+filename
|
filename=prefix+filename
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue