Возник затык на стадии выполнения makemigrations.
Выдается ошибка:
Traceback (most recent call last):
File “/home/maria/dj110/lib/python3.5/site-packages/mysql/connector/django/base.py”, line 177, in _execute_wrapper
return method(query, args)
File “/home/maria/dj110/lib/python3.5/site-packages/mysql/connector/cursor.py”, line 515, in execute
self._handle_result(self._connection.cmd_query(stmt))
File “/home/maria/dj110/lib/python3.5/site-packages/mysql/connector/connection.py”, line 488, in cmd_query
result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query))
File “/home/maria/dj110/lib/python3.5/site-packages/mysql/connector/connection.py”, line 395, in _handle_result
raise errors.get_exception(packet)
mysql.connector.errors.ProgrammingError: 1146 (42S02): Table ‘myprojectnew.module_catalog_catalog’ doesn't exist
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “manage.py”, line 9, in <module>
execute_from_command_line(sys.argv)
File “/home/maria/dj110/lib/python3.5/site-packages/django/core/management/__init__.py”, line 367, in execute_from_command_line
utility.execute()
File “/home/maria/dj110/lib/python3.5/site-packages/django/core/management/__init__.py”, line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/home/maria/dj110/lib/python3.5/site-packages/django/core/management/base.py”, line 294, in run_from_argv
self.execute(*args, **cmd_options)
File “/home/maria/dj110/lib/python3.5/site-packages/django/core/management/base.py”, line 342, in execute
self.check()
File “/home/maria/dj110/lib/python3.5/site-packages/django/core/management/base.py”, line 374, in check
include_deployment_checks=include_deployment_checks,
File “/home/maria/dj110/lib/python3.5/site-packages/django/core/management/base.py”, line 361, in _run_checks
return checks.run_checks(**kwargs)
File “/home/maria/dj110/lib/python3.5/site-packages/django/core/checks/registry.py”, line 81, in run_checks
new_errors = check(app_configs=app_configs)
File “/home/maria/dj110/lib/python3.5/site-packages/django/core/checks/urls.py”, line 14, in check_url_config
return check_resolver(resolver)
File “/home/maria/dj110/lib/python3.5/site-packages/django/core/checks/urls.py”, line 24, in check_resolver
for pattern in resolver.url_patterns:
File “/home/maria/dj110/lib/python3.5/site-packages/django/utils/functional.py”, line 35, in __get__
res = instance.__dict__ = self.func(instance)
File “/home/maria/dj110/lib/python3.5/site-packages/django/urls/resolvers.py”, line 313, in url_patterns
patterns = getattr(self.urlconf_module, “urlpatterns”, self.urlconf_module)
File “/home/maria/dj110/lib/python3.5/site-packages/django/utils/functional.py”, line 35, in __get__
res = instance.__dict__ = self.func(instance)
File “/home/maria/dj110/lib/python3.5/site-packages/django/urls/resolvers.py”, line 306, in urlconf_module
return import_module(self.urlconf_name)
File “/home/maria/dj110/lib/python3.5/importlib/__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name, package, level)
File “<frozen importlib._bootstrap>”, line 986, in _gcd_import
File “<frozen importlib._bootstrap>”, line 969, in _find_and_load
File “<frozen importlib._bootstrap>”, line 958, in _find_and_load_unlocked
File “<frozen importlib._bootstrap>”, line 673, in _load_unlocked
File “<frozen importlib._bootstrap_external>”, line 665, in exec_module
File “<frozen importlib._bootstrap>”, line 222, in _call_with_frames_removed
File “/opt/work/darnius_svn/sites/myproject/trunk3/project/urls.py”, line 13, in <module>
url(r'^admin/', include('project.admin.urls')),
File “/home/maria/dj110/lib/python3.5/site-packages/django/conf/urls/__init__.py”, line 50, in include
urlconf_module = import_module(urlconf_module)
File “/home/maria/dj110/lib/python3.5/importlib/__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name, package, level)
File “<frozen importlib._bootstrap>”, line 986, in _gcd_import
File “<frozen importlib._bootstrap>”, line 969, in _find_and_load
File “<frozen importlib._bootstrap>”, line 958, in _find_and_load_unlocked
File “<frozen importlib._bootstrap>”, line 673, in _load_unlocked
File “<frozen importlib._bootstrap_external>”, line 665, in exec_module
File “<frozen importlib._bootstrap>”, line 222, in _call_with_frames_removed
File “/opt/work/darnius_svn/sites/myproject/trunk3/project/admin/urls.py”, line 18, in <module>
url(r'^shop/', include('module_shop.admin.urls')),
File “/home/maria/dj110/lib/python3.5/site-packages/django/conf/urls/__init__.py”, line 50, in include
urlconf_module = import_module(urlconf_module)
File “/home/maria/dj110/lib/python3.5/importlib/__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name, package, level)
File “<frozen importlib._bootstrap>”, line 986, in _gcd_import
File “<frozen importlib._bootstrap>”, line 969, in _find_and_load
File “<frozen importlib._bootstrap>”, line 958, in _find_and_load_unlocked
File “<frozen importlib._bootstrap>”, line 673, in _load_unlocked
File “<frozen importlib._bootstrap_external>”, line 665, in exec_module
File “<frozen importlib._bootstrap>”, line 222, in _call_with_frames_removed
File “/opt/work/darnius_svn/sites/myproject/trunk3/module_shop/admin/urls.py”, line 3, in <module>
from .views import order, orders, order_to_pdf, product_collection_to_pdf, add_order_product_by_json, \
File “/opt/work/darnius_svn/sites/myproject/trunk3/module_shop/admin/views.py”, line 13, in <module>
from module_shop.admin.forms import OrdersForm, AddOrderProductForm, ClientForm, OrdersFormClient, \
File “/opt/work/darnius_svn/sites/myproject/trunk3/module_shop/admin/forms.py”, line 33, in <module>
class AddOrderProductForm(forms.Form):
File “/opt/work/darnius_svn/sites/myproject/trunk3/module_shop/admin/forms.py”, line 34, in AddOrderProductForm
categories = forms.ChoiceField(choices = +Catalog.get_active(), label = ‘Категория’)
File “/opt/work/darnius_svn/sites/myproject/trunk3/module_catalog/models.py”, line 102, in get_active
return [(c, c)for c in cat_list]
File “/home/maria/dj110/lib/python3.5/site-packages/django/db/models/query.py”, line 256, in __iter__
self._fetch_all()
File “/home/maria/dj110/lib/python3.5/site-packages/django/db/models/query.py”, line 1087, in _fetch_all
self._result_cache = list(self.iterator())
File “/home/maria/dj110/lib/python3.5/site-packages/django/db/models/query.py”, line 125, in __iter__
for row in compiler.results_iter():
File “/home/maria/dj110/lib/python3.5/site-packages/django/db/models/sql/compiler.py”, line 789, in results_iter
results = self.execute_sql(MULTI)
File “/home/maria/dj110/lib/python3.5/site-packages/django/db/models/sql/compiler.py”, line 835, in execute_sql
cursor.execute(sql, params)
File “/home/maria/dj110/lib/python3.5/site-packages/django/db/backends/utils.py”, line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File “/home/maria/dj110/lib/python3.5/site-packages/django/db/backends/utils.py”, line 64, in execute
return self.cursor.execute(sql, params)
File “/home/maria/dj110/lib/python3.5/site-packages/mysql/connector/django/base.py”, line 227, in execute
return self._execute_wrapper(self.cursor.execute, query, new_args)
File “/home/maria/dj110/lib/python3.5/site-packages/mysql/connector/django/base.py”, line 180, in _execute_wrapper
utils.ProgrammingError(err.msg), sys.exc_info())
File “/home/maria/dj110/lib/python3.5/site-packages/django/utils/six.py”, line 685, in reraise
raise value.with_traceback(tb)
File “/home/maria/dj110/lib/python3.5/site-packages/mysql/connector/django/base.py”, line 177, in _execute_wrapper
return method(query, args)
File “/home/maria/dj110/lib/python3.5/site-packages/mysql/connector/cursor.py”, line 515, in execute
self._handle_result(self._connection.cmd_query(stmt))
File “/home/maria/dj110/lib/python3.5/site-packages/mysql/connector/connection.py”, line 488, in cmd_query
result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query))
File “/home/maria/dj110/lib/python3.5/site-packages/mysql/connector/connection.py”, line 395, in _handle_result
raise errors.get_exception(packet)
django.db.utils.ProgrammingError: Table ‘myprojectnew.module_catalog_catalog’ doesn't exist
Код формы, на которую он ругается:
class AddOrderProductForm(forms.Form): categories = forms.ChoiceField(choices = [('0', '---')]+Catalog.get_active(), label = 'Категория') product = forms.ChoiceField(label = 'Товар') count = forms.CharField(label = 'Количество')
Вот здесь говорится, что нельзя использовать queryset в forms, но можно использовать функции, что я и сделала, но ошибка сохранилась.
Что можно сделать?