thanks. <br><br><div><span class="gmail_quote">On 12/03/2008, <b class="gmail_sendername">James Henstridge</b> &lt;<a href="mailto:james@jamesh.id.au">james@jamesh.id.au</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 12/03/2008, mark. a. brand &lt;<a href="mailto:mark.a.brand@gmail.com">mark.a.brand@gmail.com</a>&gt; wrote:<br> &gt; hi:<br> &gt;<br> &gt; *** newbie-alert ***:&nbsp;&nbsp;both python and storm<br> &gt;<br> &gt; the bit of code below - apparently works in sqlalchemy with sqlalchemy<br>
 &gt; syntax of course.<br> &gt;<br> &gt; my question is how can i do the same thing in storm, ie create a whole bunch<br> &gt; or instances at once via a dict.<br> &gt;<br> &gt; database = create_database(&quot;sqlite:hc.db&quot;)<br>
 &gt; store = Store(database)<br> &gt;<br> &gt; class Process(Storm):<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;__storm_table__ = &quot;process&quot;<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ProcessId = Int(primary = True)<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Caption = Unicode()<br> &gt;<br> &gt;&nbsp;&nbsp;store.execute(&quot;CREATE TABLE process &quot; &quot;( \<br>
 &gt;&nbsp;&nbsp;ProcessId&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VARCHAR, \<br> &gt;&nbsp;&nbsp;Caption&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VARCHAR)&quot;,<br> &gt;&nbsp;&nbsp;noresult = True \<br> &gt;&nbsp;&nbsp;)<br> &gt;<br> &gt;&nbsp;&nbsp;c = wmi.WMI ()<br> &gt;&nbsp;&nbsp;for process in c.Win32_Process ([&#39;ProcessId&#39;, &#39;Caption&#39;]):<br>
 &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;d = dict ((p, getattr (process, p)) for p in process.properties)<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Process (**d)<br> <br> <br>You need to add these process objects to the store:<br>&nbsp;&nbsp;&nbsp;&nbsp;store.add(Process(**d))<br> <br> <br> &gt; storm.flush()<br>
 &gt; storm.commit()<br> <br> And this should be store.commit() rather than storm.commit().&nbsp;&nbsp;You<br> should not need the flush() call.<br> <br><br> James.<br> </blockquote></div><br>