Patrick J. Anderson wrote:
> class ExchangeRate(models.Model):
> company = ForeignKey(Company)
> source = ForeignKey(Currency, related_name = 'source')
> destination = ForeignKey(Currency, related_name = 'destination')
> rate = FloatField(max_digits = 10, decimal_places = 2)
>
I'm not totally clear, perhaps it's a Python and not Django-specific
question, but in my e-commerce app model, I have Currency and
ExchangeRate classes:
class Currency(models.Model):
name = models.CharField(maxlength = 50)
code = models.CharField(maxlength = 3)
class Meta:
2 matches
Mail list logo