
import scrapy
from scrapy.item import BaseItem
from scrapy_rss.elements import *
from scrapy_rss import meta
import six


@six.add_metaclass(meta.ItemMeta)
class RssItem:
    title = TitleElement()
    link = LinkElement()
    description = DescriptionElement()
    author = AuthorElement()
    category = meta.MultipleElements(CategoryElement)
    comments = CommentsElement()
    enclosure = EnclosureElement()
    guid = GuidElement()
    pubDate = PubDateElement()
    source = SourceElement()


class ExtendableItem(scrapy.Item):
    def __setattr__(self, name, value):
        if name in self.fields:
            raise AttributeError("Use item[{!r}] = {!r} to set field value".format(name, value))
        super(BaseItem, self).__setattr__(name, value)


class RssedItem(ExtendableItem):
    def __init__(self, **kwargs):
        super(RssedItem, self).__init__(**kwargs)
        self.rss = RssItem()



import scrapy
from scrapy.item import BaseItem
from scrapy_rss.elements import *
from scrapy_rss import meta
import six


@six.add_metaclass(meta.ItemMeta)
class RssItem(BaseItem):
    title = TitleElement()
    link = LinkElement()
    description = DescriptionElement()
    author = AuthorElement()
    category = meta.MultipleElements(CategoryElement)
    comments = CommentsElement()
    enclosure = EnclosureElement()
    guid = GuidElement()
    pubDate = PubDateElement()
    source = SourceElement()


class ExtendableItem(scrapy.Item):
    def __setattr__(self, name, value):
        if name in self.fields:
            raise AttributeError("Use item[{!r}] = {!r} to set field value".format(name, value))
        super(BaseItem, self).__setattr__(name, value)


class RssedItem(ExtendableItem):
    def __init__(self, **kwargs):
        super(RssedItem, self).__init__(**kwargs)
        self.rss = RssItem()


Fix RssItem when each scraped item is instance of RssItem
Fix RssItem when each scraped item is instance of RssItem

  
  import scrapy
  from scrapy.item import BaseItem
  from scrapy_rss.elements import *
  from scrapy_rss import meta
  import six
  
  
  @six.add_metaclass(meta.ItemMeta)
- class RssItem:
+ class RssItem(BaseItem):
      title = TitleElement()
      link = LinkElement()
      description = DescriptionElement()
      author = AuthorElement()
      category = meta.MultipleElements(CategoryElement)
      comments = CommentsElement()
      enclosure = EnclosureElement()
      guid = GuidElement()
      pubDate = PubDateElement()
      source = SourceElement()
  
  
  class ExtendableItem(scrapy.Item):
      def __setattr__(self, name, value):
          if name in self.fields:
              raise AttributeError("Use item[{!r}] = {!r} to set field value".format(name, value))
          super(BaseItem, self).__setattr__(name, value)
  
  
  class RssedItem(ExtendableItem):
      def __init__(self, **kwargs):
          super(RssedItem, self).__init__(**kwargs)
          self.rss = RssItem()
  
  
Fix RssItem when each scraped item is instance of RssItem
## Code Before:

import scrapy
from scrapy.item import BaseItem
from scrapy_rss.elements import *
from scrapy_rss import meta
import six


@six.add_metaclass(meta.ItemMeta)
class RssItem:
    title = TitleElement()
    link = LinkElement()
    description = DescriptionElement()
    author = AuthorElement()
    category = meta.MultipleElements(CategoryElement)
    comments = CommentsElement()
    enclosure = EnclosureElement()
    guid = GuidElement()
    pubDate = PubDateElement()
    source = SourceElement()


class ExtendableItem(scrapy.Item):
    def __setattr__(self, name, value):
        if name in self.fields:
            raise AttributeError("Use item[{!r}] = {!r} to set field value".format(name, value))
        super(BaseItem, self).__setattr__(name, value)


class RssedItem(ExtendableItem):
    def __init__(self, **kwargs):
        super(RssedItem, self).__init__(**kwargs)
        self.rss = RssItem()


## Instruction:
Fix RssItem when each scraped item is instance of RssItem
## Code After:

import scrapy
from scrapy.item import BaseItem
from scrapy_rss.elements import *
from scrapy_rss import meta
import six


@six.add_metaclass(meta.ItemMeta)
class RssItem(BaseItem):
    title = TitleElement()
    link = LinkElement()
    description = DescriptionElement()
    author = AuthorElement()
    category = meta.MultipleElements(CategoryElement)
    comments = CommentsElement()
    enclosure = EnclosureElement()
    guid = GuidElement()
    pubDate = PubDateElement()
    source = SourceElement()


class ExtendableItem(scrapy.Item):
    def __setattr__(self, name, value):
        if name in self.fields:
            raise AttributeError("Use item[{!r}] = {!r} to set field value".format(name, value))
        super(BaseItem, self).__setattr__(name, value)


class RssedItem(ExtendableItem):
    def __init__(self, **kwargs):
        super(RssedItem, self).__init__(**kwargs)
        self.rss = RssItem()

