rattail.autocomplete.customers
¶
Autocomplete Handler for Customers
- class rattail.autocomplete.customers.CustomerAutocompleter(config)[source]¶
Autocompleter for Customers (by name)
- class rattail.autocomplete.customers.CustomerNewOrderAutocompleter(config)[source]¶
Special “new order” autocompleter for customers.
We set it apart with a different key (
'customers.neworder'
) so that you can override it independently of other customer autocompleters.But the default logic for this one is a bit special too, in that it will try to search for either phone number or customer name. If the search term includes at least 4 digits then it is considered to be a phone number search; otherwise it will be considered a name search.
- phone_model_class¶
alias of
CustomerPhoneNumber
- class rattail.autocomplete.customers.CustomerPhoneAutocompleter(config)[source]¶
Autocompleter for Customers (by phone)
Note
As currently implemented, this view will only work with a PostgreSQL database. It normalizes the user’s search term and the database values to numeric digits only (i.e. removes special characters from each) in order to be able to perform smarter matching. However normalizing the database value currently uses the PG SQL
regexp_replace()
function.