-
|
I have a model with a However, in the admin panel, it is converted and treated as Is there a way to override the original form? I envision a form having several number Where should I start looking into? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
The interval is treated as datetime due to the You can create a custom field and add a converter for it. Here is how you can do it class MyCustomIntervalField(BaseField):
....
class MyCustomConverter(ModelConverter): # from sqla.converters
@converts("Interval")
def conv_interval(self, *args: Any, **kwargs: Any) -> BaseField:
return MyCustomIntervalField(... )
admin.add_view(ModelView(MyModel, converter=MyCustomConverter()))For more info:
Also feel free to contribute back, it would be good to have a field for Interval by default |
Beta Was this translation helpful? Give feedback.
The interval is treated as datetime due to the
implattribute in the Interval type which is Datetime.You can create a custom field and add a converter for it. Here is how you can do it
For more info:
Also feel fr…