Changeset - a283988896b3
[Not reviewed]
0 1 0
Lance Edgar (lance) - 2 years ago 2022-08-09 14:35:57
lance@edbob.org
Add `choice_uses_dropdown()` method for customer handler
1 file changed with 15 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rattail/clientele.py
Show inline comments
 
@@ -2,7 +2,7 @@
 
################################################################################
 
#
 
#  Rattail -- Retail Software Framework
 
#  Copyright © 2010-2021 Lance Edgar
 
#  Copyright © 2010-2022 Lance Edgar
 
#
 
#  This file is part of Rattail.
 
#
 
@@ -35,6 +35,20 @@ class ClienteleHandler(GenericHandler):
 
    Base class and default implementation for clientele handlers.
 
    """
 

	
 
    def choice_uses_dropdown(self):
 
        """
 
        Returns boolean indicating whether a customer choice should be
 
        presented to the user via a dropdown (select) element, vs.  an
 
        autocomplete field.  The latter is the default because
 
        potentially the customer list can be quite large, so we avoid
 
        loading them all in the dropdown unless so configured.
 

	
 
        :returns: Boolean; if true then a dropdown should be used;
 
           otherwise (false) autocomplete is used.
 
        """
 
        return self.config.getbool('rattail', 'customers.choice_uses_dropdown',
 
                                   default=False)
 

	
 
    def ensure_customer(self, person):
 
        """
 
        Returns the customer record associated with the given person, creating
0 comments (0 inline, 0 general)