Traceback (most recent call last):
File "apps/common/parse.py", line 177, in <module>
real()
File "apps/common/parse.py", line 61, in real
dictNew.objects.bulk_create(dnReal)
File "/home/fine/.virtualenvs/rss/local/lib/python2.7/site-packages/django/db/models/manager.py", line 160, in bulk_create
return self.get_queryset().bulk_create(*args, **kwargs)
File "/home/fine/.virtualenvs/rss/local/lib/python2.7/site-packages/django/db/models/query.py", line 359, in bulk_create
self._batched_insert(objs_without_pk, fields, batch_size)
File "/home/fine/.virtualenvs/rss/local/lib/python2.7/site-packages/django/db/models/query.py", line 838, in _batched_insert
using=self.db)
File "/home/fine/.virtualenvs/rss/local/lib/python2.7/site-packages/django/db/models/manager.py", line 232, in _insert
return insert_query(self.model, objs, fields, **kwargs)
File "/home/fine/.virtualenvs/rss/local/lib/python2.7/site-packages/django/db/models/query.py", line 1514, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "/home/fine/.virtualenvs/rss/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 902, in execute_sql
for sql, params in self.as_sql():
File "/home/fine/.virtualenvs/rss/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 860, in as_sql
for obj in self.query.objs
File "/home/fine/.virtualenvs/rss/local/lib/python2.7/site-packages/django/db/models/fields/related.py", line 1236, in get_db_prep_save
connection=connection)
File "/home/fine/.virtualenvs/rss/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 350, in get_db_prep_save
prepared=False)
File "/home/fine/.virtualenvs/rss/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 607, in get_db_prep_value
value = connection.ops.validate_autopk_value(value)
File "/home/fine/.virtualenvs/rss/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 336, in validate_autopk_value
raise ValueError('The database backend does not accept 0 as a '
ValueError: The database backend does not accept 0 as a value for AutoField.
думаю:
1. Может быть bulk_create работает с объектами Django, у меня же словарь.
Поиск dictionary to objects django ничего не дает.
2. Может надо в словарь добавить id, тоже пока не понял как.
Updated 17 Sept. 2014, 14:49 by rsserg.