I am new to python framework and jar.
My problem is that I have to do an edit page. Therefore, I need to transfer all the information about the object to the form. Detail:
My object has this structure:
class TVChannel(Document): __collection__ = 'tvchannels' use_dot_notation = True structure = { '_id' : basestring, 'name' : unicode, 'streams' : { 'city1': { 'adapt' : basestring, 'hds' : basestring, 'hls' : basestring, 'rtmp' : basestring, }, 'city2': { 'adapt' : basestring, 'hds' : basestring, 'hls' : basestring, 'rtmp' : basestring, } } }
and in view:
channel_obj = db.TVChannel().get_id(channel_id)
The object_channel "name" they understand and pass it on, as usual. But the βstreamsβ, they did not recognize and conveyed it something like this:
class ChannelForm(Form): _id = HiddenField() name = TextField(_('channel name')) streams = { 'city1': { 'adapt' : TextField(_('stream adapt link')), 'hds' : TextField(_('stream hds link')), 'hls' : TextField(_('stream hls link')), 'rtmp' : TextField(_('stream rtmp link')), }, 'city2': { 'adapt' : TextField(_('stream adapt link')), 'hds' : TextField(_('stream hds link')), 'hls' : TextField(_('stream hls link')), 'rtmp' : TextField(_('stream rtmp link')), } } submit = SubmitField(_('Save'))
What should I do? Or, anyway, change the way the object data is transferred to this form parameter?