Make readonly version of batch file field not show download link.
This commit is contained in:
parent
e216ed9281
commit
364a38a936
|
@ -31,6 +31,8 @@ import stat
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from formalchemy.ext import fsblob
|
from formalchemy.ext import fsblob
|
||||||
|
from formalchemy.fields import FileFieldRenderer as Base
|
||||||
|
from formalchemy.helpers import hidden_field
|
||||||
|
|
||||||
|
|
||||||
class FileFieldRenderer(fsblob.FileFieldRenderer):
|
class FileFieldRenderer(fsblob.FileFieldRenderer):
|
||||||
|
@ -62,3 +64,6 @@ class FileFieldRenderer(fsblob.FileFieldRenderer):
|
||||||
def get_url(self, filename):
|
def get_url(self, filename):
|
||||||
batch = self.field.parent.model
|
batch = self.field.parent.model
|
||||||
return self.view.request.route_url('{0}.download'.format(self.view.route_prefix), uuid=batch.uuid)
|
return self.view.request.route_url('{0}.download'.format(self.view.route_prefix), uuid=batch.uuid)
|
||||||
|
|
||||||
|
def render(self, **kwargs):
|
||||||
|
return Base.render(self, **kwargs)
|
||||||
|
|
Loading…
Reference in a new issue