Closed sachinwhiteman7 closed 4 years ago
@Pegase745 i'm trying to fetch a table using datatables, i have defined three columns (id, phone and status ), but i'm getting a result like this, [(<Block 11>, 11, '7735353545', 'blocked')] first element is a model object, how can i remove that
my file looks like this,
columns = [ColumnDT(Block.id), ColumnDT(Block.phonenumber), ColumnDT(Block.status), ] query = Block.query.filter() row_table = DataTables(request.args, query, columns) return jsonify(row_table.output_result())
and i'm getting this error
TypeError: Object of type 'Block' is not JSON serializable
it worked when i changed to query = db.session.query().select_from(Block).filter()
@sachinwhiteman7 does your issue seem readable to you ?
Please don't use the title section in order to describe your issue.