forex/models.py
def save(self, *args, **kwargs):
        """
        Sanitation checks
        """
        if self.ask_price < 0:
            raise ValidationError("Ask price must be greater than zero")
        if self.bid_price < 0:
            raise ValidationError("Bid price must be greater than zero")
        if self.ask_price < self.bid_price:
            raise ValidationError("Ask price must be at least Bid price")

        super(CurrencyPrice, self).save(*args, **kwargs)
def save(self, *args, **kwargs):
        """
        Sanitation checks
        """
        if self.ask_price < 0:
            raise ValidationError("Ask price must be greater than zero")
        if self.bid_price < 0:
            raise ValidationError("Bid price must be greater than zero")
        if self.ask_price < self.bid_price:
            raise ValidationError("Ask price must be at least Bid price")

        super(CurrencyPrice, self).save(*args, **kwargs)
def save ( self , * args , * * kwargs ) : if self . ask_price < 0 : raise ValidationError ( "Ask price must be greater than zero" ) if self . bid_price < 0 : raise ValidationError ( "Bid price must be greater than zero" ) if self . ask_price < self . bid_price : raise ValidationError ( "Ask price must be at least Bid price" ) super ( CurrencyPrice , self ) . save ( * args , * * kwargs )
Sanitation checks
Sanitation checks