class AbstractMoneyModel(models.Model): amount = MoneyField(max_digits=10, decimal_places=2, default_currency='USD') m2m_field = models.ManyToManyField(ModelWithDefaultAsInt) class Meta: abstract = True
class TestModel(Model): field = MoneyField(**field_kwargs) class Meta: app_label = 'test'
class InheritedMoneyModel(SimpleMoneyModel): amount2 = MoneyField(max_digits=10, decimal_places=2, default_currency='USD')
class InheritorMoneyModel(AbstractMoneyModel): amount2 = MoneyField(max_digits=10, decimal_places=2, default_currency='USD')
class ModelWithTwoMoneyFields(models.Model): amount1 = MoneyField(max_digits=10, decimal_places=2) amount2 = MoneyField(max_digits=10, decimal_places=3)
class ModelWithDefaultAsStringWithCurrency(models.Model): amount = MoneyField(default='123 EUR', max_digits=10, decimal_places=2)
class NullMoneyFieldModel(models.Model): amount = MoneyField(max_digits=10, decimal_places=2, null=True, default_currency='EUR', blank=True)
class ModelWithDefaultAsDecimal(models.Model): amount = MoneyField(default=Decimal('0.01'), max_digits=10, decimal_places=2, default_currency='CHF')
class ModelWithDefaultAsMoney(models.Model): amount = MoneyField(default=Money('0.01', 'RUB'), max_digits=10, decimal_places=2)
class ModelWithDefaultAsFloat(models.Model): amount = MoneyField(default=12.05, max_digits=10, decimal_places=2, default_currency='PLN')
class ModelWithDefaultAsInt(models.Model): amount = MoneyField(default=123, max_digits=10, decimal_places=2, default_currency='GHS')
class ModelWithDefaultAsString(models.Model): amount = MoneyField(default='123', max_digits=10, decimal_places=2, default_currency='PLN')
class ModelWithCustomManager(models.Model): field = MoneyField(max_digits=10, decimal_places=2) manager = money_manager(MoneyManager())
class SimpleMoneyModel(models.Model): amount = MoneyField(max_digits=10, decimal_places=2, default_currency='EUR')