Ricciflows

Ricciflows

Invalid Date

时间主宰一切,但是时间终究不如因果...

智力值

0

金币

0

粉丝

0

  • 复制链接
  • 分享至QQ
  • 分享至QQ空间
  • 分享至微博
  • 微信扫一扫
Backend

Backend

This circle is for technical discussion of backend programming.

Members
2
  • Home
  • Wiki
  • Circles
  • Shop
  • Django Django
    Search
    English
    Trading
  • Circle Home
  • Encyclopedia
  • Questions
  • Posts
  • Help Center
  • About Manitori
  • Issues
  • Privacy Policy
HomeQuestions

Questions in

Ask question

全部

内容 1|
RicciflowsRicciflows
|
10 months ago
|
Question

Django change an existing field to foreign key

I have a Django model that used to look like this:class Car(models.Model): manufacturer_id = models.IntegerField()There is another model called Manufacturer that the id field refers to. However, I realized that it would be useful to use Django's built-in foreign key functionality, so I changed the model to this:class Car(models.Model): manufacturer = models.ForeignKey(Manufacturer)This change appears to work fine immediately, queries work without errors, but when I try to run migrations, ...

python
django
django-migrations
python-3.x
342
1 answer
全部
Django

Django

分享

This circle is for Django programming. Django is a Python web framework.

Created at2024-08-09 22:13
Members0
Parent circle
BackendBackend
⭕

Founder

RicciflowsRicciflows

Master

RicciflowsRicciflows