Add multiply filter
This commit is contained in:
		
					parent
					
						
							
								567ff8d314
							
						
					
				
			
			
				commit
				
					
						16e5fb8f5c
					
				
			
		
					 1 changed files with 11 additions and 0 deletions
				
			
		| 
						 | 
					@ -31,3 +31,14 @@ def get_value_from_dict(dict_data, key):
 | 
				
			||||||
        return dict_data.get(key)
 | 
					        return dict_data.get(key)
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
        return ""
 | 
					        return ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@register.filter('multiply')
 | 
				
			||||||
 | 
					def multiply(value, arg):
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					    usage: {{ quantity|multiply:price }}
 | 
				
			||||||
 | 
					    :param value:
 | 
				
			||||||
 | 
					    :param arg:
 | 
				
			||||||
 | 
					    :return:
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					    return value*arg
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue