def dimension_data(dims, tag): # dimension count name = u"_".join([prefix, tag, 'dimN']) value = str(len(dims)) output.append(html.hidden_input(name=name, value=value)) # dimension lengths for i, dim in enumerate(dims): name = u"_".join([prefix, tag, 'length', str(i)]) value = str(len(dim.values())) output.append(html.hidden_input(name=name, value=value))
def hidden_data_instanceids(self, prefix): ids = json.dumps(self.cell_instance_ids()) name = u"_".join([prefix, "instanceids"]) output = [] output.append(html.hidden_input(name=name, value=ids)) return u'\n'.join(output)
def render_fixed_data(self, prefix): output = [] fixed = [(fieldname, value) for fieldname, value in self.data.fixed_fields] for fieldname, value in fixed: name = u"_".join([prefix, 'fixed', fieldname]) valuestr = self.field_hidden_representation(fieldname, value) output.append(html.hidden_input(name=name, value=valuestr)) return u'\n'.join(output)
def dimension_values(dims, tag): for i, dim in enumerate(dims): if not isinstance(dim, InputDim): name = u"_".join([prefix, tag, 'values', str(i)]) value = self.dim_hidden_representations(dim) output.append(html.hidden_input(name=name, value=value))