On the Json+Storm thing
from storm.locals import *
from storm.info import *
from storm.properties import *
import json
class Products(object):
__storm_table__ = "products"
__storm_primary__ = "lProductId"
strName = Unicode(name = 'NAME')
lProductId = Int (name = 'PRODUCTID')
lVendorId = Int (name = 'VENDORID')
m_strBarCode = Unicode(name = 'BARCODE')
strUnit = Unicode(name =
'UNIT') #; // Way the item is messure
# blah blah blah a bunch of fields
def __init__(self):
print self
def PrintProductsJson():
AllProducts = store.find(Products)
print AllProducts.count()
for products in AllProducts:
# here I am printing a json string
# it looks like a lot of work.... but it works
# I guess you can create a dictionary with matching json id I will
return with the data
print json.dumps({'PRODUCTID': products.lProductId,
'NAME': products.strName,
'MODIFDATE':
products.strLastDateModified.strftime('%Y-%m-%dT%H:%M:%S')})
--
storm mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/storm