模块' django.db.models'没有属性' Foreignkey'

时间:2017-03-27 18:04:04

标签: python django django-forms

我是Django的新手,我刚开始通过示例使用Djaango学习它,但我收到错误消息。 这是我的追溯

-p

这是模型文件,我已经完成了它,似乎我没有犯任何错误。我

C:\Users\Harsley\shop>python manage.py makemigrations
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\Harsley\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "C:\Users\Harsley\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py", line 328, in execute
    django.setup()
  File "C:\Users\Harsley\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\Harsley\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "C:\Users\Harsley\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "C:\Users\Harsley\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "C:\Users\Harsley\shop\shops\models.py", line 16, in <module>
    class Product(models.Model):
  File "C:\Users\Harsley\shop\shops\models.py", line 17, in Product
    category = models.Foreignkey(Category,related_name='products')
AttributeError: module 'django.db.models' has no attribute 'Foreignkey'

1 个答案:

答案 0 :(得分:1)

  ...
  x: counter port map(A, m1);
  B <= std_logic_vector(resize(60 * unsigned(m1), B'length));
  ...