Open kaldown opened 4 years ago
I have a
class UserAdminView(ModelView): hidden_field = String()
and I need UserAdminView to contain a clickable URL defined by hidden_field.
UserAdminView
Something like:
class UserAdminView(ModelView): hidden_field = String() an_url = URLField(href=build_url, value=hidden_field)
Tried
form_overrides = { 'an_url': MyField, } form_widget_args={ "an_url": { "readonly": True, "href": 'http://example.com', }, } class MyField(URLField): def _value(self): if self.data: self.data = build_url(self.data) return super()._value()
At least overridden _value gives some results. But how to safely make an URL from a resulted string. Such as it's just a text, no even I inherited from an URLField
_value
How to at least wrap a field with the html?
I have a
and I need
UserAdminView
to contain a clickable URL defined by hidden_field.Something like:
Tried
At least overridden
_value
gives some results. But how to safely make an URL from a resulted string. Such as it's just a text, no even I inherited from an URLField