Learner looking for assistance

Anthony Smith jackie.walkabout at gmail.com
Tue Apr 15 03:52:16 EDT 2014


On Monday, 14 April 2014 17:43:41 UTC+10, Anthony Smith  wrote:
> Hi All
> 
> 
> 
> I am probably doing something wrong but don't know what 
> 
> Any help would great 
> 
> 
> 
> Code below 
> 
> 
> 
> the calc_total does not return a estimated_total_weight
> 
> 
> 
> if add the estimated_total_weight the rest of the code works 
> 
> 
> 
> I am at a lose as to why ?????
> 
> 
> 
> def calc_total(self):
> 
>     	amount = 0
> 
>     	if self.estimated_weight_hd > 0:
> 
>             amount = self.number * self.estimated_weight_hd
> 
> 	return amount
> 
> 		   	
> 
> 	def save(self):
> 
> 		self.estimated_total_weight = self.calc_total()
> 
>     		super(SaleNote, self).save()
> 
> 		
> 
>     def calc_total_price(self):
> 
>     	amount_price = 0
> 
> 	if self.sale_head > 0:
> 
> 	    amount_price = self.number * self.sale_head
> 
>             return amount_price
> 
>         else:
> 
>             if self.estimated_total_weight > 0:
> 
>                 amount_price = self.estimated_total_weight * self.sale_kg
> 
> 	return amount_price
> 
> 
> 
>     def save(self):
> 
> 		self.total_price = self.calc_total_price()
> 
> 		super(SaleNote, self).save()
> 
> 
> 
> thanks 
> 
> 
> 
> anthony

Hi 

To see what I am trying go to yambuk.no-ip.org:8000/admin

this will allow hands on what I am what the program does 

username python password test



More information about the Python-list mailing list