Skip to content

Commit

Permalink
Add label property to edit type checkbox. (#959)
Browse files Browse the repository at this point in the history
Co-authored-by: wlorenzetti <[email protected]>
  • Loading branch information
wlorenzetti and wlorenzetti authored Oct 21, 2024
1 parent 3516b5c commit e7de5ed
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions g3w-admin/qdjango/utils/edittype.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,24 @@ class QgisEditTypeCheckBox(QgisEditType):

@property
def input_form(self):
displaymethod = getattr(self, 'TextDisplayMethod', 0)
checkedstate = getattr(self, 'CheckedState','TRUE')
uncheckedstate = getattr(self, 'UncheckedState', 'TRUE')
return {
'input': {
'type': self.field_type,
'options': {
'values': [
{'value': getattr(self, 'CheckedState',
'TRUE'), 'checked': True},
{'value': getattr(
self, 'UncheckedState', 'FALSE'), 'checked': False},
{
'value': checkedstate,
'label': checkedstate if displaymethod == 1 else 'True',
'checked': True
},
{
'value': uncheckedstate,
'label': uncheckedstate if displaymethod == 1 else 'False',
'checked': False
},
]
}
}
Expand Down

0 comments on commit e7de5ed

Please sign in to comment.