|
@@ -211,10 +211,12 @@ class ObjectVar(ScriptVariable):
|
|
|
:param context: A custom dictionary mapping template context variables to fields, used when rendering <option>
|
|
:param context: A custom dictionary mapping template context variables to fields, used when rendering <option>
|
|
|
elements within the dropdown menu (optional)
|
|
elements within the dropdown menu (optional)
|
|
|
:param null_option: The label to use as a "null" selection option (optional)
|
|
:param null_option: The label to use as a "null" selection option (optional)
|
|
|
|
|
+ :param selector: Include an advanced object selection widget to assist the user in identifying the desired
|
|
|
|
|
+ object (optional)
|
|
|
"""
|
|
"""
|
|
|
form_field = DynamicModelChoiceField
|
|
form_field = DynamicModelChoiceField
|
|
|
|
|
|
|
|
- def __init__(self, model, query_params=None, context=None, null_option=None, *args, **kwargs):
|
|
|
|
|
|
|
+ def __init__(self, model, query_params=None, context=None, null_option=None, selector=False, *args, **kwargs):
|
|
|
super().__init__(*args, **kwargs)
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
|
|
|
self.field_attrs.update({
|
|
self.field_attrs.update({
|
|
@@ -222,6 +224,7 @@ class ObjectVar(ScriptVariable):
|
|
|
'query_params': query_params,
|
|
'query_params': query_params,
|
|
|
'context': context,
|
|
'context': context,
|
|
|
'null_option': null_option,
|
|
'null_option': null_option,
|
|
|
|
|
+ 'selector': selector,
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
|