【问题标题】:custom table to ForeignKey自定义表到 ForeignKey
【发布时间】:2015-10-21 10:29:57
【问题描述】:

我需要自定义表模型到 ForeignKey

employee_id = models.ForeignKey(ExternalDatabase)
user = models.ForeignKey(User)

我需要从不是 Django 模型的旧表中获取employee_id

如何通过原始查询获取 ExternalDatabase 并将其显示在管理列表中,如 ForeignKey 字段

【问题讨论】:

标签: django python-2.7 django-models


【解决方案1】:

【讨论】:

    猜你喜欢
    • 2018-11-24
    • 1970-01-01
    • 2014-09-06
    • 1970-01-01
    • 2016-03-23
    • 2011-11-25
    • 1970-01-01
    • 2021-04-20
    • 1970-01-01
    相关资源
    最近更新 更多