Documentation for stdnet 0.8.2. For development docs, go here.

Field GeneratorΒΆ

This tutorial is about the use of JSONField with parameter JSONField.as_string set to False. Lets start with a model for a general data feed:

class Feed(odm.StdModel):
    name = odm.SymbolField()
    data = odm.JSONField(as_string=False)

lets create an instance:

feed = Feed(name='goog').save() = {'price': {'bid': 750, 'offer':751},
             'volume': 2762355371,
             'mkt_cap': '255B',
             'pe': 23}

When loading the instance one can access all the fields in the following way:['price']['bid']['price']['offer']

or equivalently:


Previous topic


Next topic

Primary Keys and Unique Fields

This Page