Python 将django 1.6升级到1.7。“的通用关系是否有任何变化?”;相关名称;?

Python 将django 1.6升级到1.7。“的通用关系是否有任何变化?”;相关名称;?,python,django,upgrade,Python,Django,Upgrade,我正在尝试将一个项目从Django 1.6升级到1.7。当我尝试运行服务器时,我得到“TypeError:init()得到一个意外的关键字参数'related_name'”: $./manage.py runserver--settings=bertonealer.settings.local 0.0.0.0:8000 回溯(最近一次呼叫最后一次): 文件“/manage.py”,第10行,在 从命令行(sys.argv)执行命令 文件“/home/vagrant/.virtualenvs/de

我正在尝试将一个项目从Django 1.6升级到1.7。当我尝试运行服务器时,我得到“TypeError:init()得到一个意外的关键字参数'related_name'”:

$./manage.py runserver--settings=bertonealer.settings.local 0.0.0.0:8000
回溯(最近一次呼叫最后一次):
文件“/manage.py”,第10行,在
从命令行(sys.argv)执行命令
文件“/home/vagrant/.virtualenvs/dealer17/local/lib/python2.7/site packages/django/core/management/_init__.py”,第385行,从命令行执行
utility.execute()
文件“/home/vagrant/.virtualenvs/dealer17/local/lib/python2.7/site packages/django/core/management/_init__.py”,执行中第354行
django.setup()
文件“/home/vagrant/.virtualenvs/dealer17/local/lib/python2.7/site packages/django/_init__.py”,第21行,在安装程序中
应用程序。填充(设置。已安装的应用程序)
文件“/home/vagrant/.virtualenvs/dealer17/local/lib/python2.7/site packages/django/apps/registry.py”,第108行,填充
app_config.import_models(所有_models)
导入模型中的文件“/home/vagrant/.virtualenvs/dealer17/local/lib/python2.7/site packages/django/apps/config.py”,第197行
self.models\u module=导入模块(models\u module\u name)
文件“/usr/lib/python2.7/importlib/_init_uuu.py”,第37行,在导入模块中
__导入(名称)
文件“/vagrant_data/projects/companyapps/clientes/models.py”,第3行,在
从distribuidores.models导入Empresa作为Distribuidor
文件“/vagrant_data/projects/companyapps/distribuidores/models.py”,第50行,在
Empresa类(models.Model):
文件“/vagrant_data/projects/companyapps/distribuidores/models.py”,第88行,在Empresa中
eventos=generic.genericorrelation(Evento,related\u name='distributidores\u set')
文件“/home/vagrant/.virtualenvs/dealer17/local/lib/python2.7/site packages/django/contrib/contenttypes/fields.py”,第266行,在__
from_fields=[self.object_id_field_name],**kwargs)
文件“/home/vagrant/.virtualenvs/dealer17/local/lib/python2.7/site-packages/django/db/models/fields/related.py”,第1309行,在__
超级(外来对象,自身)。\uuuuu初始值(**kwargs)
TypeError:\uuuu init\uuuuuuuuuuuuuuuuuuu()获取了意外的关键字参数“related\u name”

这与Django 1.7中的任何更改有关吗?

GenericKey没有
相关的\u名称

但是您可以在django 1.7中使用而不是
相关的\u名称

$ ./manage.py runserver --settings=bertondealer.settings.local 0.0.0.0:8000

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/vagrant/.virtualenvs/dealer17/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/vagrant/.virtualenvs/dealer17/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute
    django.setup()
  File "/home/vagrant/.virtualenvs/dealer17/local/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/vagrant/.virtualenvs/dealer17/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/home/vagrant/.virtualenvs/dealer17/local/lib/python2.7/site-packages/django/apps/config.py", line 197, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/vagrant_data/projects/companyapps/clientes/models.py", line 3, in <module>
    from distribuidores.models import Empresa as Distribuidor
  File "/vagrant_data/projects/companyapps/distribuidores/models.py", line 50, in <module>
    class Empresa(models.Model):
  File "/vagrant_data/projects/companyapps/distribuidores/models.py", line 88, in Empresa
    eventos = generic.GenericRelation(Evento, related_name='distribuidores_set')
  File "/home/vagrant/.virtualenvs/dealer17/local/lib/python2.7/site-packages/django/contrib/contenttypes/fields.py", line 266, in __init__
    from_fields=[self.object_id_field_name], **kwargs)
  File "/home/vagrant/.virtualenvs/dealer17/local/lib/python2.7/site-packages/django/db/models/fields/related.py", line 1309, in __init__
    super(ForeignObject, self).__init__(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'related_name'