title: How to pass an object instance to a jinja html template
body: <p>My class looks like this</p>
  
  <pre><code>class Foo():
      x = attrib()
      y = attrib()
  
  
  f = Foo(x=1, y=2)
  </code></pre>
  
  <p>My template looks like</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
   &lt;span&gt;{{x}}&lt;/span&gt; -&gt; instead of this I want to use foo.x
   &lt;span&gt;{{y}}&lt;/span&gt; -&gt; instead of this I want to use foo.y
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I use <code>template.render(**attr.asdict(f))</code> to render it.
  Instead I want to just pass <code>template.render(f)</code> and use <code>{{f.x}}</code> and <code>{{f.y}}</code></p>
  
  <p>Is there a way to do this?
  I keep running into the error</p>
  
  <pre><code>vars = dict(*args, **kwargs)
  TypeError: 'Foo' object is not iterable
  </code></pre>