title: python Django - Convert SQL Query to ORM Query
body: <p>I want sql query to orm</p>
  
  <pre><code>SELECT id, title,
  (SELECT SUM(AMOUNT) FROM web_history A WHERE A.car_id = B.id AND type = 3)
  FROM web_car B;
  
  
  histories = History.objects.filter(car=OuterRef('pk'), type=3)
  cars = Car.objects.annotate(count=Subquery(histories.annotate(a=Sum('amount'))))
  </code></pre>
  
  <p>This can not be done by setting the output_field ... I can not solve it even if I apply variously from FloatField to Char through Concat.
  I leave a comment on whether I can get advice.</p>