Oscar Campos | 3 Apr 2013 16:38
Gravatar

Invalid enum value on find

Hi all.

I have an enumeration defined in the usual way:
    class Card(Storm):
        __storm_table__ = 'b2c_credit_cards'
        ...
        card_type = Enum(map={
            'VISA': 1, 'MC': 2, 'LASER': 3, 'AMEX': 4,
            'DINERS': 5, 'DELTA': 6, 'MAESTRO': 7
        })
        ...

If I create a new Card object I can flush the store and commit without
any problem, of course I am able to use card.card_type = 'VISA' but when
I try to load it from the database I always get a ValueError exception
like "Invalid enum value u:'VISA' (or whatever other card type I did
store first)"

I'm using MySQL 5.1.66, Storm 0.19 and Python 2.7.3

Someone have any idea about how to solve this?

Best Regards.

Kai Luo | 16 Mar 2013 10:26

Emoji support

Dear storm team,

Would you please add Emoji support? This is getting more and more popular among iOS & Mac users.

http://en.wikipedia.org/wiki/Emoji


Thanks
Kai
<div>
<div>
                    Dear storm team,
                </div>
<div><br></div>
<div>Would you please add Emoji support? This is getting more and more popular among iOS &amp; Mac users.</div>
<div><br></div>
<div>http://en.wikipedia.org/wiki/Emoji</div>
<div><br></div>
<div><br></div>
<div>Thanks</div>
<div>Kai</div>
                <div></div>
</div>
Ming Lee | 5 Mar 2013 07:30
Picon

Re: storm Digest, Vol 59, Issue 2

Yeah, I intsalled it with those three cmds, 

The error just says ' no module named storm.locals'
At last, I gave up, and upgrade to 12.04, and reinstalled it with the same three cmds, 
and it works.
Thanks for your reply.

On Mon, Mar 4, 2013 at 8:00 PM, <storm-request-33AaDErTWvAAkhNd+W/JZw@public.gmane.orgcom> wrote:
Send storm mailing list submissions to
        storm-33AaDErTWvA@public.gmane.orgnonical.com

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.ubuntu.com/mailman/listinfo/storm
or, via email, send a message with subject or body 'help' to
        storm-request-33AaDErTWvAAkhNd+W/JZ0EOCMrvLtNR@public.gmane.org

You can reach the person managing the list at
        storm-owner-33AaDErTWvAAkhNd+W/JZ0EOCMrvLtNR@public.gmane.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of storm digest..."


Today's Topics:

   1. Re: ImportError on Ubuntu 11.10 (Free Ekanayaka)


----------------------------------------------------------------------

Message: 1
Date: Mon, 4 Mar 2013 09:23:10 +0100
From: Free Ekanayaka <free.ekanayaka-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Ming Lee <cloudniw1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: storm-33AaDErTWvAAkhNd+W/JZ0EOCMrvLtNR@public.gmane.org
Subject: Re: [storm] ImportError on Ubuntu 11.10
Message-ID:
        <CABJ6Wij+wNZ4bbTJ9w=UdysGGamewxn_+gqRAVQ=vxkjFQDPog-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Content-Type: text/plain; charset=ISO-8859-1

Hi,

On Sun, Mar 3, 2013 at 7:12 AM, Ming Lee <cloudniw1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi, all,
> After I installed the python-storm with these three commands on the tutorial
> page

Do you mean these three:

sudo add-apt-repository ppa:storm/ppa
sudo apt-get update
sudo apt-get install python-storm

?

If so, it might be that the version in that ppa doesn't really work on
Ubuntu 11.10. I suggest that you remove the package and the ppa:

sudo apt-get remove python-apt
sudo rm -f /etc/apt/sources.list.d/storm-ppa-*.list
sudo apt-get update

and install the official version of the package for Ubuntu 11.10:

sudo apt-get install python-storm

Alternatively, please let me know what import error are you getting
exactly (paste the full traceback that you get).

Cheers,

Free



------------------------------

--
storm mailing list
storm-33AaDErTWvAAkhNd+W/JZ0EOCMrvLtNR@public.gmane.org
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/storm


End of storm Digest, Vol 59, Issue 2
************************************

<div>
<p>Yeah, I intsalled it with those three cmds,&nbsp;</p>
<div>The error just says ' no module named storm.locals'</div>
<div>At last, I gave up, and upgrade to 12.04, and reinstalled it with the same three cmds,&nbsp;</div>
<div>and it works.</div>
<div>Thanks for your reply.</div>
<div>
<br><div class="gmail_quote">On Mon, Mar 4, 2013 at 8:00 PM,  <span dir="ltr">&lt;<a href="mailto:storm-request@..." target="_blank">storm-request@...com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">Send storm mailing list submissions to<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:storm@...">storm@...nonical.com</a><br><br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="https://lists.ubuntu.com/mailman/listinfo/storm" target="_blank">https://lists.ubuntu.com/mailman/listinfo/storm</a><br>
or, via email, send a message with subject or body 'help' to<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:storm-request@...">storm-request@...</a><br><br>
You can reach the person managing the list at<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:storm-owner@...">storm-owner@...</a><br><br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of storm digest..."<br><br><br>
Today's Topics:<br><br>
&nbsp; &nbsp;1. Re: ImportError on Ubuntu 11.10 (Free Ekanayaka)<br><br><br>
----------------------------------------------------------------------<br><br>
Message: 1<br>
Date: Mon, 4 Mar 2013 09:23:10 +0100<br>
From: Free Ekanayaka &lt;<a href="mailto:free.ekanayaka@...">free.ekanayaka@...</a>&gt;<br>
To: Ming Lee &lt;<a href="mailto:cloudniw1@...">cloudniw1@...</a>&gt;<br>
Cc: <a href="mailto:storm@...">storm@...</a><br>
Subject: Re: [storm] ImportError on Ubuntu 11.10<br>
Message-ID:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;CABJ6Wij+wNZ4bbTJ9w=UdysGGamewxn_+gqRAVQ=<a href="mailto:vxkjFQDPog@...">vxkjFQDPog@...</a>&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1<br><br>
Hi,<br><br>
On Sun, Mar 3, 2013 at 7:12 AM, Ming Lee &lt;<a href="mailto:cloudniw1 <at> gmail.com">cloudniw1@...</a>&gt; wrote:<br>
&gt; Hi, all,<br>
&gt; After I installed the python-storm with these three commands on the tutorial<br>
&gt; page<br><br>
Do you mean these three:<br><br>
sudo add-apt-repository ppa:storm/ppa<br>
sudo apt-get update<br>
sudo apt-get install python-storm<br><br>
?<br><br>
If so, it might be that the version in that ppa doesn't really work on<br>
Ubuntu 11.10. I suggest that you remove the package and the ppa:<br><br>
sudo apt-get remove python-apt<br>
sudo rm -f /etc/apt/sources.list.d/storm-ppa-*.list<br>
sudo apt-get update<br><br>
and install the official version of the package for Ubuntu 11.10:<br><br>
sudo apt-get install python-storm<br><br>
Alternatively, please let me know what import error are you getting<br>
exactly (paste the full traceback that you get).<br><br>
Cheers,<br><br>
Free<br><br><br><br>
------------------------------<br><span class="HOEnZb"><br>
--<br>
storm mailing list<br><a href="mailto:storm@...">storm@...</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/storm" target="_blank">https://lists.ubuntu.com/mailman/listinfo/storm</a><br><br><br>
End of storm Digest, Vol 59, Issue 2<br>
************************************<br></span>
</blockquote>
</div>
<br>
</div>
</div>
Ming Lee | 3 Mar 2013 07:12
Picon

ImportError on Ubuntu 11.10

Hi, all,

After I installed the python-storm with these three commands on the tutorial page, I can't do from storm.locals import *, the package has been installed correctly, but just can't be used, why? Thanks.
<div>
<p>Hi, all,</p>
<div>After I installed the python-storm with these three commands on the tutorial page, I can't do from storm.locals&nbsp;import&nbsp;*, the package has been installed correctly, but just can't be used, why? Thanks.</div>
</div>

probable bug in storm/0.19/storm.twisted.transact causes high db locks.

While debugging some code of the Globaleaks software i've probably
found a bug related to storm integration with twisted.

in reference to storm/0.19/storm.twisted.transact, the
time.sleep(seconds) inside  <at> transact decorator causes a long db lock
in case of exceptions.

in my opinion, the retry mechanism needs to be implemented outside of
the  <at> transact method and not vice versa. 	furthermore a sleep
expressed in seconds is probably too long for a transaction retry.

here are some reference to the issue and to the temporary fix:
https://github.com/globaleaks/GLBackend/issues/44
https://github.com/globaleaks/GLBackend/commit/aec7e6902ed64ba33f856ca6bd69aa049a6cf64d

best regards,

Giovanni `evilaliv3` Pellerano

Free Ekanayaka | 2 Jan 2013 17:37
Picon

Releasing 0.20

Hi folks,

the last Storm release (0.19) is now more than a year old. Shall we
release 0.20? Any blocker/RC for that?

Cheers,

Free

Arturo Filastò | 19 Dec 2012 00:29

Re: Is storm still active?

> On Mon, Oct 1, 2012 at 7:53 PM, daniels <daniels0xff at gmail.com
>> wrote:
>> Hi,
>> 
>> I just found out about storm and it looks awesome.
>> I would like to use it in a project and my question is if storm is still active and maintained?
>> Is is stable to be used in production?
> 
> 
> Development of Storm has slowed down recently, but I wouldn't consider
> it inactive.  One thing to note is that most (all?) of the developers
> work on Storm to further other projects that make use of the library,
> so one explanation for the slowed development is that it currently
> satisfies most of their requirements for an SQL database ORM.  This
> isn't to say that things are perfect: we certainly could do better
> w.r.t. documentation, for instance.
> 
> As for whether it is suitable for use in production, it is currently
> used at Canonical in Launchpad, Landscape and Ubuntu One, which are
> all non trivial sites with large numbers of users.

This is quite comforting to know. 

We are currently using Storm for an open source application: 
https://github.com/globaleaks/GLBackend.

Are any of the projects you mentioned above open source?

We are especially interested in using Storm with Twisted and 
having pieces of code that demonstrate it's proper usage would 
be of great help.

Thanks!

~ Art.
Daniel Åkerud | 15 Dec 2012 21:49
Picon
Gravatar

SELECT with expressions, how to use new column


Hello! I'm using Storm with a mysql backend, and I'm doing a select with an expression, like this:

result = self.store.find((Report, SQL("CURRENT_TIMESTAMP") - Report.timestamp as age), SQL("CURRENT_TIMESTAMP") - Report.timestamp < $max_age)


i.e:
SELECT *, (CURRENT_TIMESTAMP - timestamp) AS age FROM report WHERE report.(CURRENT_TIMESTAMP - timestamp) < $max_age;

(notice the "AS age")

So I want to use the new column in Storm, but do not know how to achieve that.

Thanks!

PS: If you know how to optimise away writing "SQL("CURRENT_TIMESTAMP") - Report.timestamp" twice, that would be SUPER :-)

-- 

BR/D



<div>
<div>
                    <br>
</div>
<div><span>Hello! I'm using Storm with a mysql backend, and I'm doing a select with an expression, like this:</span></div>
<div><span><br></span></div>
<div><p>result = self.store.find((Report, SQL(<span>"CURRENT_TIMESTAMP"</span>) - Report.timestamp as age), SQL(<span>"CURRENT_TIMESTAMP"</span>) - Report.timestamp &lt; $max_age)</p></div>
<div><br></div>
<div>
<div><span>i.e:</span></div>
<div>SELECT *, (CURRENT_TIMESTAMP - timestamp) AS age FROM report WHERE report.(CURRENT_TIMESTAMP - timestamp) &lt; $max_age;</div>
<div><div></div></div>
</div>
<div><br></div>
<div><span>(notice the "AS age")</span></div>
<div><span><br></span></div>
<div><span>So I want to use the new column in Storm, but do not know how to achieve that.</span></div>
<div><span><br></span></div>
<div><span>Thanks!</span></div>
<div>
<div><div><div><br></div></div></div>
<div>
<span>PS: If you know how to&nbsp;optimise&nbsp;away writing "</span><span>SQL(</span><span>"CURRENT_TIMESTAMP"</span><span>) - Report.timestamp</span><span>" twice, that would be SUPER :-)</span>
</div>
<div><p>--&nbsp;</p></div>
<div>BR/D</div>
<div><br></div>
<div><br></div>
<div><br></div>
</div>
</div>
daniels | 9 Oct 2012 18:50
Picon

strom c extension

I' see that storm has a .c file. Does it need this compiled to run? Does it work without it?
Thanks.
daniels | 1 Oct 2012 13:53
Picon

Is storm still active?

Hi, 

I just found out about storm and it looks awesome.
I would like to use it in a project and my question is if storm is still active and maintained?
Is is stable to be used in production?
Ryan Haynes | 10 Apr 2012 20:00
Picon

Compressed Pickle and RawStrings

Hello All,

I recently started using storm.  Thanks a lot for the work on this.  A
quick question... I have relatively sparse numpy objects that I'd like
to persist into RawStr.  Would it make sense to add a compression
facility into the Columns that accept blobs?  I currently just do the
following...

class BlockAttribution(Block):
    __storm_table__ = "block_attributions"
    #  This is a bz2 compressed pickled numpy array.
    _data = None
    _data_db = RawStr(name=u"data")

     <at> property
    def data(self):
        if self._data_db is None:
            return None
        elif self._data is None:
            self._data = pickle.loads(bz2.decompress(self._data_db))
        return self._data

     <at> data.setter
    def data(self, value):
        self._data = value
        self._pack(value)

    def _pack(self, value):
        compress_lvl = 5
        self._data_db = bz2.compress(pickle.dumps(self._data), compress_lvl)

     <at> data.deleter
    def data(self):
        self._pack(self._data)
        del self._data

It seems to persist to the media well.  However, this is only safe
because I'm working in a non-threaded context and I expect all changes
to this object to local until I flush it to the DB.

I dunno, maybe this is a completely broken thing to do.  But if there
was something like a opencl BZ library this could be an awesome way of
persisting objects.

Cheers,
Ryan


Gmane