arteria / cmsplugin-contact-plus

With cmsplugin-contact-plus building custom forms for your django-cms project is a breeze. Now it's so easy to build the forms with exactly the fields you want in the order you want - with a minimal effort.
https://github.com/arteria/cmsplugin-contact-plus
BSD 3-Clause "New" or "Revised" License
30 stars 33 forks source link

on_delete issue #65

Open FabriceSalvaire opened 5 years ago

FabriceSalvaire commented 5 years ago
  File "/home/www/django/home-page-cms/cmsplugin_contact_plus/models.py", line 107, in ExtraField
    form = models.ForeignKey(ContactPlus, verbose_name=_("Contact Form"))
TypeError: __init__() missing 1 required positional argument: 'on_delete'

added , on_delete=models.CASCADE as quick fix

tehfink commented 4 years ago

Patched version for 1.3.16 here: https://github.com/atiberghien/cmsplugin-contact-plus

Ludo-q commented 3 years ago

Hello!

I'm having the same problem, I have installed the last version using: pip install -e git+git://github.com/arteria/cmsplugin-contact-plus.git#egg=cmsplugin_contact_plus

But when execute: python manage.py migrate

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\User\Workspace\rash.al\env\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "C:\Users\User\Workspace\rash.al\env\lib\site-packages\django\core\management\__init__.py", line 357, in execute
    django.setup()
  File "C:\Users\User\Workspace\rash.al\env\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\User\Workspace\rash.al\env\lib\site-packages\django\apps\registry.py", line 114, in populate
    app_config.import_models()
  File "C:\Users\User\Workspace\rash.al\env\lib\site-packages\django\apps\config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "C:\Python36\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "c:\users\user\workspace\rash.al\env\src\cmsplugin-contact-plus\cmsplugin_contact_plus\models.py", line 104, in <module>
    class ExtraField(SortableMixin):
  File "c:\users\user\workspace\rash.al\env\src\cmsplugin-contact-plus\cmsplugin_contact_plus\models.py", line 107, in ExtraField
    form = models.ForeignKey(ContactPlus, verbose_name=_("Contact Form"))
TypeError: __init__() missing 1 required positional argument: 'on_delete'

I'm using:

Django==2.2.16 django-cms==3.7.0 django-admin-sortable==2.2.3

Can someone help me?