title: How to fix 'AttributeError: 'dict' object has no attribute 'code'
body: <p>I am trying to parse all <strong>plugin</strong> tags from an XML file and build a dict using a <strong>Plugin</strong> class I created. <em>I really do not understand the error and the context of the error.</em></p>
  
  <p><code>.append()</code> does not seem to work when I try to initialize the <code>plugin_dict</code> as a list. Also when I try to call <code>__init__()</code> function like <code>plugin = Plugin()</code>, I get an error that <em>Plugin</em> needs at least 1 argument when I have already implemented a <code>__init__(self)</code> function which requires no arguments.</p>
  
  <p>Here is the code from <strong>main.py</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>from plugin import Plugin
  from bs4 import BeautifulSoup
  
  def parse():
      file = open('../data/windows.xml')
      soup = BeautifulSoup(file, 'xml')
      plugins = soup.find_all('plugin')
      plugin_dict = []
      for plugin in plugins:
          plugin_dict.append(Plugin(plugin))
      return plugin_dict
  </code></pre>
  
  <p>where <strong>plugin.py</strong> is:</p>
  
  <pre class="lang-py prettyprint-override"><code>class Plugin(object):
      __name = 'Unknown'
      __vendor = {}
      __vendor_name = 'Unknown, Inc.'
      __vendor_producturl = 'http://www.example.com/product'
      __vendor = [__vendor_name, __vendor_producturl]
      __version = {}
      __version_code = '0.0.0.0'
      __version_release_date = '01-01-1970'
      __version = [__version_code, __version_release_date]
      __properties = {}
      __beta = False
      __vst3 = False
      __x64 = False
      __category = 'synth/effect'
      __properties = {__beta, __vst3, __x64, __category}
      __magnet_uri = {}
      __iss_links = {}
      __download_uri = {}
      __downloads = {}
      __downloads = [__magnet_uri, __iss_links, __download_uri]
  
      def __init__(self):
          '''Create an empty instance for later use'''
          self.name = str(__name)
          self.version = {}
          self.version.code = str(__version[0])
          self.version.releasedate = str(__version[1])
          self.version = [self.version.code, self.version.releasedate]
          self.vendor = {}
          self.vendor.name = str(__vendor_name)
          self.vendor.producturl = str(__vendor_producturl)
          self.vendor = [self.vendor.name, self.vendor.producturl]
          self.properties = {}
          self.properties.beta = bool(__properties[0])
          self.properties.vst3 = bool(__properties[1])
          self.properties.x64 = bool(__properties[2])
          self.properties.category = str(__properties[3])
          self.properties = [self.properties.beta, self.properties.vst3, self.properties.x64, self.properties.category]
          self.magneturi = list(__magnet_uri)
          self.isslinks = list(__iss_links)
          self.downloaduri = list(__download_uri)
          self.downloads = {}
          self.downloads = [self.magneturi, self.isslinks, self.downloaduri]
          self.product_dict = {}
          self.product_dict = [self.name, self.vendor, self.properties, self.downloads]
          return self.product_dict
  
      def __init__(self, plugin):
          self.name = plugin['name']
          self.version = {}
          self.version.code = plugin.version.code.string
          self.version.releasedate = plugin.version.releasedate.string
          self.version = [self.version.code, self.version.releasedate]
          self.vendor= {}
          self.vendor.name = plugin.vendor.string
          self.vendor.producturl = plugin.vendor['url']
          self.vendor = [self.vendor.name, self.vendor.producturl]
          self.properties = {}
          self.properties.beta = plugin['beta']
          self.properties.vst3 = plugin['vst3']
          self.properties.x64 = plugin['x64']
          self.properties.category = plugin['category']
          self.properties = [self.properties.beta, self.properties.vst3, self.properties.x64, self.properties.category]
          magnet_uri_dict = {}
          magnet_uri_dict = plugin.find_all('magnet')
          for magnet_uri in magnet_uri_dict:
              self.magneturi.append[magnet_uri.name, magnet_uri.string]
          iss_link_dict = {}
          iss_link_dict = plugin.find_all('iss/*')
          for iss_link in iss_link_dict:
              self.isslinks.append(iss_link.string)
          download_uri_dict = {}
          download_uri_dict = plugin.find_all('download-uri/*')
          for download_uri in download_uri_dict:
              self.downloaduri.append(download_uri.string)
          self.downloads = {}
          self.downloads = [self.magneturi, self.isslinks, self.downloaduri]
          self.product_dict = {}
          self.product_dict = [self.name, self.vendor, self.properties, self.downloads]
          return self.product_dict
  </code></pre>
  
  <p>and a plugin tag in <strong>windows.xml</strong> looks like:</p>
  
  <pre class="lang-xml prettyprint-override"><code>    &lt;plugin name="Serum" vst3="false" beta="false" x64="true" category="synth"&gt;
          &lt;vendor url=""&gt;Xfer Records&lt;/vendor&gt;
          &lt;version&gt;
              &lt;code&gt;1.248&lt;/code&gt;
              &lt;release-date&gt;13-03-2019&lt;/release-date&gt;
          &lt;/version&gt;
          &lt;download-uri&gt;
              &lt;zippy&gt;PLACEHOLDER&lt;/zippy&gt;
              &lt;openload&gt;PLACEHOLDER&lt;/openload&gt;
              &lt;sr-files&gt;PLACEHOLDER&lt;/sr-files&gt;
          &lt;/download-uri&gt;
          &lt;iss&gt;
              &lt;mirror1&gt;PLACEHOLDER&lt;/mirror1&gt;
              &lt;mirror2&gt;PLACEHOLDER&lt;/mirror2&gt;
              &lt;mirror3&gt;PLACEHOLDER&lt;/mirror3&gt;
          &lt;/iss&gt;
          &lt;magnet type="default"&gt;&lt;/magnet&gt;
      &lt;/plugin&gt;
  </code></pre>
  
  <p>I think I am going wrong with defining <code>self.version.something</code>; I never saw an example like that. I just used it for better classification of the XML into an object</p>
  
  <hr>
  
  <p>If you think that I should mark this as <strong>python-3.x</strong> also then please tell</p>