def as_dict(self, id=None, **attrs):
        data = self.layout.as_dict(self.form)
        form = data['field']
        if 'model' not in form:
            form['model'] = self.form.__class__.__name__
        if id is None and not form.get('id'):
            id = '%s_%s' % (self.form.__class__.__name__.lower(),
                            get_random_string(5))
        if id:
            form['id'] = id
        form.update(attrs)
        return data
dataset/ETHPy150Open quantmind/lux/lux/forms/serialise.py/SerialisedForm.as_dict/original