我有那种模型: class Publisher(models.Model):
...
class Author(models.Model):
publisher = models.ForeignKey(Publisher, on_delete=models.CASCADE)
class Article(models.Model):
author= models
我在我的应用程序的SQLite数据库上进行“插入”时遇到了“逻辑”问题。 这些是我的表格。 我应该如何管理检索CONTACT_ID和photos_id为了使插入到表contact_photo的“需要”? 我知道我可以通过SQLite生成的最后_id与SELECT seq from sqlite_sequence where ...,但这似乎并不是一个“专业”的解决方案。 有没有更好的方法来实现我的
我正在与拥有一对多关系的两个公司和访问者合作。 public class Company
{
public int CompanyID { get; set; }
public string CompanyName { get; set; }
public virtual ICollection<Visitor> Visitors { get; set; }
}