我在做新闻模型。我有一个列表页和一个详细页。 我需要在详细信息页面与选择其他相关的新闻在管理面板,并保存在网站上的选项
我的型号:
class News(models.Model):
title = models.CharField(max_length=500)
subtitle = models.CharField(max_length=1000, blank=True)
text = models.TextField()
link = models.ForeignKey('.'.join(LINK_MODEL), null=True, blank=True)
link_title = models.CharField(max_length=500)
date = models.DateField(null=True)
image = FilerImageField()
class Meta:
verbose_name_plural = 'news'
ordering = ['-date']
我应该用外键吗
目前没有回答
相关问题 更多 >
编程相关推荐