Foreignkey转换为charfield

时间:2019-04-03 18:30:13

标签: django message

我正在尝试用户到用户的消息应用程序。但是发件人和收件人是组合框ı不想组合框。我要对输入框的发件人和收件人进行charfield(输入)。怎么做

class mesaj(models.Model):
    sender = models.ForeignKey(User, related_name='gonderen',blank=True, null=True, on_delete=models.CASCADE)
    recipient = models.ForeignKey(User, related_name='alici',on_delete=models.CASCADE,null=True,)
    subject = models.CharField(max_length=250, blank=True)
    message = models.TextField()
    sent = models.DateTimeField(auto_now_add=True)

0 个答案:

没有答案