При выводе из базы данных таблицы Car, в поле car_brand вместо name приезжает id от Manufacturer. Как это изменить?
class Manufacturer(models.Model):
name = models.CharField(max_length=128, unique=True)
class Car(models.Model):
car_brand = models.ForeignKey(Manufacturer, on_delete=models.CASCADE,)
componentDidMount() {
axios
.get(getResourceURL("car"))
.then((result) => {
this.setState({
car: result.data
})
})
.catch((error) => console.log(error));
}
const Car = ({car}) => {
//{ console.log('car:', car);}
return (
<tr className="cars-list">
<td>
{car.id}
</td>
<td>
{car.car_brand}
</td>
<td>
<Link to={`/car/detail/${car.id}`} className="nav-link">
{car.model}
</Link>
</td>
<td>
{car.price}
</td>
<td>
{car.max_speed}
</td>
<td>
<Link to={`/cars/delete/${car.id}`} className="nav-link">
delete
</Link>
</td>
</tr>
)
}