All pastes #161789 Raw Edit

Anonymous

public python v1 · immutable
·published 2006-09-05 20:28 UTC
rendered paste body
class POSLocation(models.Model):  '''A POSLocation is a point-of-sale location'''    name = models.CharField(_('''the name of this point-of-sale location'''))  tax_policy = '''What should I put here?'''class ITaxPolicy(object):  def calculateTax(self, Order):    # Order is another Django model class    raise NotImplementedError, 'Subclass me!'class MASalesTax(ITaxPolicy):  def calculateTax(self, Order):    return taxEverythingExceptClothes(0.05, Order)question = '''How should I make POSLocation.tax_policy reference ITaxPolicy classes so that a POSLocation object can get the appropriate ITaxPolicy object?'''