models.py
class FixedIncome(Asset):
isin = models.CharField(max_length=6, blank=False)
coupon = models.DecimalField(max_digits=7, decimal_places=4, help_text="Percent")
payment_frequency = models.ForeignKey(PaymentFrequency)
months = models.ManyToManyField(Month, blank = False, verbose_name = "Payment months")
duration = models.DecimalField(max_digits=4, decimal_places=2, default='0')
maturity_date = models.DateTimeField(default=datetime.now, blank=False)
class Meta:
verbose_name_plural = "Fixed Income"
我希望django admin只在选择月份(数字1到12,下拉框)时显示maturity_date属性。我看过一些关于js的内容,但我不会做:(