- changed status to resolved
BaseDatatableView returns model data wrapped in anchor tag when 'get_absolute_url' is defined on model
This the json output
{"result": "ok", "draw": 0, "data": [["<a href=\"/matriaspirants/1/\">/media/images/2015/11/02/Dr._VARSHA_PHOTOS_081.jpg</a>", "<a href=\"/matriaspirants/1/\">Male</a>", "<a href=\"/matriaspirants/1/\">hindu</a>", "<a href=\"/matriaspirants/1/\">2015-10-30</a>", "<a href=\"/matriaspirants/1/\">Light</a>"], ["<a href=\"/matriaspirants/2/\">/media/images/2015/11/02/MichelBuffa.gif</a>", "<a href=\"/matriaspirants/2/\">Male</a>", "<a href=\"/matriaspirants/2/\">hindu</a>", "<a href=\"/matriaspirants/2/\">2015-11-01</a>", "<a href=\"/matriaspirants/2/\">Light</a>"], ["<a href=\"/matriaspirants/3/\">/media/images/2015/11/02/Dr._VARSHA_PHOTOS_081_poRlxyB.jpg</a>", "<a href=\"/matriaspirants/3/\">Male</a>", "<a href=\"/matriaspirants/3/\">hind</a>", "<a href=\"/matriaspirants/3/\">2015-11-02</a>", "<a href=\"/matriaspirants/3/\">Light</a>"]], "recordsFiltered": 3, "recordsTotal": 3}
Comments (3)
-
reporter -
repo owner - changed status to closed
OK :)
-
I’d love to know how to get around this?
When I define
get_absolute_url()
on a model, it renders a link for every field. I want a link only for the name field in the resulting datatable. - Log in to comment
ok my bad that's ok ,, i'll tweak the code to suit my use case , i looked at code.. and i will make the tweak as i want just the model field in json return data. thanks .