Подключил к проекту базу postgres, провел все миграции, они применились, в моделях нигде нет ограничения в 300 символов, но вылетает эта ошибка. Причем в базе все сохраняется, после того как вылетает ошибка, перезагружаю страницу и значение сохраняется, в самой базе тоже нет никаких ошибок при добавлении напрямую, ограничений на 300 символов тоже нет. Раз дело не в базе, то в чем? Может я не так провел миграции? Но они применились правильно, я удалял их, удалял базу, пересоздавал базу заново, менял кодировки, но все в бестолку, миграции применяются, но ошибка продолжает вылетать. Может это проблема ORM? Подскажите пожалуйста где может быть проблема и что я делаю не так.
Traceback:
Environment:
Request Method: POST
Request URL: http://192.168.10.222:8080/base/edit_project/1099/
Django Version: 2.2
Python Version: 3.8.7
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'templatesApp',
'changelog',
'accounts',
'dashboard',
'reference',
'baseTables',
'adminTables',
'reports']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback:
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py" in _execute
84. return self.cursor.execute(sql, params)
The above exception (value too long for type character varying(300)
) was the direct cause of the following exception:
File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)
File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/base.py" in _get_response
115. response = self.process_exception_by_middleware(e, request)
File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/base.py" in _get_response
113. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/contrib/auth/decorators.py" in _wrapped_view
21. return view_func(request, *args, **kwargs)
File "/home/itpw/project/nik/vkmtsup_django2/vkmt_sup/baseTables/views.py" in EditProjectView
613. obj.save()
File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py" in save
740. self.save_base(using=using, force_insert=force_insert,
File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py" in save_base
788. post_save.send(
File "/usr/local/lib/python3.8/dist-packages/django/dispatch/dispatcher.py" in send
173. return [
File "/usr/local/lib/python3.8/dist-packages/django/dispatch/dispatcher.py" in <listcomp>
174. (receiver, receiver(signal=self, sender=sender, **named))
File "/home/itpw/project/nik/vkmtsup_django2/vkmt_sup/changelog/signals.py" in journal_save_handler
19. ChangeLog.add(instance, loggedIn.current_user, loggedIn.address, ACTION_UPDATE, (instance._meta.get_field(change).verbose_name.title()+': '+str(changed[change]['old'])+' --> ' +str(changed[change]['new'])), id=last_saved['id'])
File "/home/itpw/project/nik/vkmtsup_django2/vkmt_sup/changelog/models.py" in add
47. log.save()
File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py" in save
740. self.save_base(using=using, force_insert=force_insert,
File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py" in save_base
777. updated = self._save_table(
File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py" in _save_table
870. result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py" in _do_insert
907. return manager._insert([self], fields=fields, return_id=update_pk,
File "/usr/local/lib/python3.8/dist-packages/django/db/models/manager.py" in manager_method
82. return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py" in _insert
1186. return query.get_compiler(using=using).execute_sql(return_id)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/sql/compiler.py" in execute_sql
1332. cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py" in execute
99. return super().execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py" in execute
67. return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py" in _execute_with_wrappers
76. return executor(sql, params, many, context)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py" in _execute
84. return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py" in __exit__
89. raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py" in _execute
84. return self.cursor.execute(sql, params)
Exception Type: DataError at /base/edit_project/1099/
Exception Value: value too long for type character varying(300)