mirror of https://github.com/scrapy/scrapy.git
fixed bug in DjangoItem
This commit is contained in:
parent
8efe6eb55e
commit
62e03419b7
|
|
@ -12,9 +12,9 @@ class DjangoItemMeta(ItemMeta):
|
|||
cls._model_meta = cls.django_model._meta
|
||||
for model_field in cls._model_meta.fields:
|
||||
# XXX: for now we're treating each PK as autogenerated field
|
||||
if model_field != cls._model_meta.pk and \
|
||||
model_field.name not in cls.fields:
|
||||
cls.fields[model_field.name] = Field()
|
||||
if model_field != cls._model_meta.pk:
|
||||
if model_field.name not in cls.fields:
|
||||
cls.fields[model_field.name] = Field()
|
||||
cls._model_fields.append(model_field.name)
|
||||
return cls
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue