How to change value ID to model attribute in Queryset

Django QuerySets return the PK of the associated objects but I need the attribute name. For example Sitting.objects.filter(complete=True).values(‘user’) would return a QuerySet like: <QuerySet[{‘user’:2}, {‘user’:3}]>. How do I easily convert the 2 to user.get_full_name() or such? To give an idea of what I was trying: tests_taken = Sitting.objects.filter(complete=True).values(‘user’) for test in tests_taken: try: tests_taken[test][‘user’] =…

Details

how to get the selected option from dropdown list and convert all product prices according to base currency in laravel

This is my code to get all currencies exchange rate according to base currency through api key. public function rates() { $uri = sprintf($this->config(‘api_key’)); $request = $this->httpClient->get($uri); $content = $request->getBody()->getContents(); $response = json_decode($content); return (array) $response; } This is my controller public function json(){ $cur= ExchangeRate::rates(); return $cur; } This is my route Route::get(‘/json-api’, ‘[email protected]’);…

Details