Skip to content

Commit

Permalink
Add QgisEditTypeRelationReference for ReletaionReference widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
wlorenzetti committed Oct 11, 2023
1 parent c2edb6b commit 0c79285
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion g3w-admin/qdjango/utils/edittype.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,39 @@ def input_form(self):
}


class QgisEditTypeRelationReference(QgisEditTypeValueMap):
"""
Class for Relation Reference and autocomplete.
"""

field_type = FORM_FIELD_TYPE_SELECT_AUTOCOMPLETE

@property
def input_form(self):

input_form = super(QgisEditTypeRelationReference, self).input_form

# Explode Filter Expression
#filter_expression = explode_expression(self.FilterExpression) if self.FilterExpression != '' else None

# add params for get value
input_form['input']['options'].update({
'relation_id': self.Layer,
'loading': {
'state': None
},
#'filter_expression': filter_expression,
})

return input_form

MAPPING_EDITTYPE_QGISEDITTYPE = {
'CheckBox': QgisEditTypeCheckBox,
'DateTime': QgisEditTypeDateTime,
'Range': QgisEditTypeRange,
'ValueMap': QgisEditTypeValueMap,
'UniqueValues': QgisEditTypeUniqueValue,
'ExternalResource': QgisEditTypeExternalResource,
'ValueRelation': QgisEditTypeValueRelation
'ValueRelation': QgisEditTypeValueRelation,
#'RelationReference': QgisEditTypeRelationReference
}

0 comments on commit 0c79285

Please sign in to comment.