Hi team, i used generic.RetrieveAPIVIEW class in drf django and i in t
Hi team, i used generic.RetrieveAPIVIEW class in drf django and i in this class i used get_object method in this method
return output=get_objects_or_404(mymodel,id=2)
how can i add new field in this query?
When i used output.newfield=4 it can not add this field to output

Rajanikant HawaldarRank #107 · 20.6K reputationPosted Nov 28, 2020, 10:05 PM EST
Rajanikant HawaldarRank #107 · 20.6K reputationPosted Nov 28, 2020, 9:50 PM EST
Vikram Tripathi197 reputationPosted Nov 28, 2020, 10:54 PM EST
Sachin SinghRank #66 · 26.2K reputationPosted Nov 28, 2020, 8:53 PM EST
Vikram Tripathi197 reputationPosted Nov 28, 2020, 9:54 PM EST
Rajanikant HawaldarRank #107 · 20.6K reputationPosted Nov 28, 2020, 9:57 PM EST
Vikram Tripathi197 reputationPosted Nov 28, 2020, 10:01 PM EST
Vikram Tripathi197 reputationPosted Nov 28, 2020, 10:07 PM EST
Rajanikant HawaldarRank #107 · 20.6K reputationPosted Nov 28, 2020, 10:09 PM EST
Vikram Tripathi197 reputationPosted Nov 28, 2020, 10:11 PM EST