I have Product
model and my products don’t have available_quantity
and prices
field because these field are in another service. So I added custom field to my queryset.
This is my code;
for product in queryset:
product.info_bundle = {
'available_quantity': stock_info.get(product.stock_code),
'prices': 100,
}
I added my custom info_bundle
field to queryset.
Problem is; I can’t order with queryset.order_by(‘avaliable_quantity’)
because I added this. It’s not coming from database therefore SQL cant find the field.