diff options
author | luxagraf <sng@luxagraf.net> | 2018-03-22 11:02:14 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2018-03-22 11:02:14 -0500 |
commit | ec28a9b734ded0ee3267c925546ba66f73b1fd34 (patch) | |
tree | fbef7f3f31b914c0628b69ea905b423230422b09 /app/sightings/autocomplete_light_registry.py | |
parent | c94a996b590a59aa4bc2c746c5ce6f7fad902189 (diff) |
added autocomplete to sightings so it's easier to find APs
Diffstat (limited to 'app/sightings/autocomplete_light_registry.py')
-rw-r--r-- | app/sightings/autocomplete_light_registry.py | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/app/sightings/autocomplete_light_registry.py b/app/sightings/autocomplete_light_registry.py index 1cfa881..9c113d0 100644 --- a/app/sightings/autocomplete_light_registry.py +++ b/app/sightings/autocomplete_light_registry.py @@ -1,24 +1,14 @@ import autocomplete_light.shortcuts as al -from .models import Bird +from .models import AP -# This will generate a PersonAutocomplete class -al.register(Bird, - # Just like in ModelAdmin.search_fields - search_fields=['common_name','scientific_name'], +al.register(AP, + search_fields=['common_name',], attrs={ - # This will set the input placeholder attribute: - 'placeholder': 'Tags...', - # 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). + 'placeholder': 'Animal/Plant...', + 'data-autocomplete-minimum-characters': 2, + }, widget_attrs={ 'data-widget-maximum-values': 4, - # Enable modern-style widget ! 'class': 'modern-style', }, ) |