33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
|
import autocomplete_light.shortcuts as al
|
||
|
from models import ICD10CMfinal
|
||
|
|
||
|
# This will generate a PersonAutocomplete class
|
||
|
al.register(ICD10CMfinal,
|
||
|
# Just like in ModelAdmin.search_fields
|
||
|
search_fields=[
|
||
|
'^ICD9CM_code',
|
||
|
'ICD9CM_English',
|
||
|
'^ICD10CM',
|
||
|
'ICD10CM_English',
|
||
|
],
|
||
|
attrs={
|
||
|
# This will set the input placeholder attribute:
|
||
|
# 'placeholder': 'Other model name ?',
|
||
|
# This will set the yourlabs.Autocomplete.minimumCharacters
|
||
|
# options, the naming conversion is handled by jQuery
|
||
|
'data-autocomplete-minimum-characters': 1,
|
||
|
},
|
||
|
# This will set the data-widget-maximum-values attribute on the
|
||
|
# widget container element, and will be set to
|
||
|
# yourlabs.Widget.maximumValues (jQuery handles the naming
|
||
|
# conversion).
|
||
|
widget_attrs={
|
||
|
'data-widget-maximum-values': 4,
|
||
|
# Enable modern-style widget !
|
||
|
'class': 'modern-style',
|
||
|
|
||
|
# 'style': "background-color: yellow; width: 375px; display: inline-block;",
|
||
|
'style': "width: 576px; display: inline-block;",
|
||
|
},
|
||
|
)
|