微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Django FormSet 两个表

如何解决Django FormSet 两个表

我有两张表,员工和薪水。每个月都会为所有员工创建一个工资表。并将一个列在另一个之下。

像 django 管理员一样可编辑:django admin
但是一对多不会选择,会并排的例子:here

像“sql内连接”İMAGE

“没有选择会按日期创建自己的选择。我可以在工作人员旁边进行编辑”

    class Personel(models.Model):
    ad = models.CharField(blank=True,null=True,max_length=50)
    Soyad = models.CharField(blank=True,max_length=50)
    netmaas = models.DecimalField(blank=True,max_digits=10,decimal_places=3)
    gorev = models.CharField(blank=True,max_length=50)
    tc = models.CharField(blank=True,max_length=11)
    telefon = models.CharField(blank=True,max_length=12)
    aktif = models.BooleanField(verbose_name='Aktif',default=True)
    aciklama = models.CharField(blank=True,max_length=100)

class Bodro(models.Model):
    netmaas = models.DecimalField(blank=True,decimal_places=3)
    cgsmaas = models.IntegerField(blank=True,default=30)
    fm = models.DecimalField(blank=True,decimal_places=3)
    rtc = models.DecimalField(blank=True,decimal_places=3)
    htc = models.DecimalField(blank=True,decimal_places=3)
    dbc = models.DecimalField(blank=True,decimal_places=3)
    bes = models.DecimalField(blank=True,decimal_places=3)
    ekkesinti = models.DecimalField(blank=True,decimal_places=3)
    eködeme = models.DecimalField(blank=True,decimal_places=3) 
    agi= models.DecimalField(blank=True,decimal_places=3)
    hakedis= models.DecimalField(blank=True,decimal_places=3)
    personel = models.ForeignKey('Personel',on_delete=models.CASCADE)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。