Skip to Content
Menu
This question has been flagged
1 Atsakyti
2682 Rodiniai

I have a selection field as follows:


source = fields.Selection([
('one', 'First'),
('two', 'Second'),
('three', 'Third'),
('four', 'Fourth'),
('five', 'Fifth'),
], required=True, default='one')


How can I show but inactive some of these options?


at the moment these options are all visible and selectable but I want some to be visible but inactive so not being selectable.

Portretas
Atmesti
Best Answer

Hello 

you can not inactive but based on your condition you can add and remove using fields_view_get method

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
rugp. 17
7111
1
rugs. 23
3997
1
rugs. 23
2716
2
birž. 18
4912
2
birž. 23
4956