求助,django中外键的问题
我的代码是这样的:
from django.db import models
# Create your models here.
class Publisher(models.Model):
name=models.CharField(max_length=30)
address=models.CharField(max_length=50)
city=models.CharField(max_length=60)
state_province=models.CharField(max_length=30)
country=models.CharField(max_length=50)
website=models.URLField()
class Author(models.Model):
salutation=models.CharField(max_length=10)
first_name=models.CharField(max_length=30)
last_name=models.CharField(max_length=40)
email=models.EmailField()
headshot=models.ImageField(upload_to='/tmp')
class Book(models.Model):
title=models.CharField(max_length=100)
authors=models.ManyToManyField(Author)
publisher=models.Foreignkey(Publisher)
publication_date=models.DateField()
运行下面的命令,提示错误:
D:\Django\mysite>python manage.py validate
AttributeError: 'module' object has no attribute 'Foreignkey'
找了很多地方,没找到原因,请各位指教。我用的是django 1.5.1的版本 Django Python
[解决办法]
ForeignKey,K大写。