healthier/models.py
def search(food_name):
        """ 
        Takes food_name:<STR> returns a Tuple (<Queryset> or Food_item object, number of items found)
        Searches through the DB if food_name exists among Food_items names.
        """
        try:
            f = Food_item.objects.get(name__icontains=food_name)
            return (f, 1)
        except (MultipleObjectsReturned, ObjectDoesNotExist):
            f = (
                Food_item.objects.filter(name__icontains=food_name)
                .order_by("name")
                .distinct("name")
            )
            return (f, f.all().count())
 
        Takes food_name:<STR> returns a Tuple (<Queryset> or Food_item object, number of items found)
        Searches through the DB if food_name exists among Food_items names.
        
Takes food_name: returns a Tuple ( or Food_item object, number of items found)
Searches through the DB if food_name exists among Food_items names.
Takes food_name : returns a Tuple ( or Food_item object number of items found ) Searches through the DB if food_name exists among Food_items names .
def search(food_name):
        try:
            f = Food_item.objects.get(name__icontains=food_name)
            return (f, 1)
        except (MultipleObjectsReturned, ObjectDoesNotExist):
            f = (
                Food_item.objects.filter(name__icontains=food_name)
                .order_by("name")
                .distinct("name")
            )
            return (f, f.all().count())
def search ( food_name ) : try : f = Food_item . objects . get ( name__icontains = food_name ) return ( f , 1 ) except ( MultipleObjectsReturned , ObjectDoesNotExist ) : f = ( Food_item . objects . filter ( name__icontains = food_name ) . order_by ( "name" ) . distinct ( "name" ) ) return ( f , f . all ( ) . count ( ) )
Takes food_name:<STR> returns a Tuple (<Queryset> or Food_item object, number of items found)
Searches through the DB if food_name exists among Food_items names.
Takes food_name : <STR > returns a Tuple ( <Queryset > or Food_item object number of items found ) Searches through the DB if food_name exists among Food_items names .
""" 
        Takes food_name:<STR> returns a Tuple (<Queryset> or Food_item object, number of items found)
        Searches through the DB if food_name exists among Food_items names.
        """
food_name