猿问

Django:处理定期付款时推荐的客户和付款模型定义

假设我有两个模型,一个Customer用于Payment. 每个月我customer都应该在每个月的 15 号之前付款。构建模型以便轻松获得当月未付款的客户报告的最佳方法是什么?


客户型号:


class CustomerModel(models.Model):

    first_name = models.TextField()

    last_name = models.TextField()

    email = models.EmailField()

支付模式:


class Payment(models.Model):

    customer = models.ForeignKey(

               Customer,

               on_delete=models.SET_NULL,

               null=True) 

    amount = models.FloatField()

    date_received = models.DateField(auto_now=False)


哔哔one
浏览 153回答 1
1回答
随时随地看视频慕课网APP

相关分类

Python
我要回答