SHARE
TWEET

Untitled

a guest May 16th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # 1-3 ์ด ์ฟผ๋ฆฌ๋Š” ์˜๋„ํ•œ๋Œ€๋กœ +1๊ฐœ์˜ ์ฟผ๋ฆฌ๋กœ related_order๋ฅผ ์กฐํšŒํ•œ๋‹ค
  2. # filter์ ˆ์—์„œ related_order์— ๋Œ€ํ•ด ๋ณ„๋‹ค๋ฅธ ๋‚ด์šฉ์ด ์—†์–ด์„œ ๋ฐ˜ํ•ญ์—†์ด ๊ฐœ๋ฐœ์ž์˜ ์˜๋„๋Œ€๋กœ ๋”ฐ๋ผ์ค€๋‹ค.
  3. OrderedProduct.objects.filter(product_cnt=30).prefetch_related('related_order')
  4. """
  5.     SELECT *
  6.     FROM "orm_practice_app_orderedproduct"
  7.      WHERE "orm_practice_app_orderedproduct"."product_cnt" = 30;
  8.  
  9.     SELECT *
  10.      FROM "orm_practice_app_order"
  11.      WHERE "orm_practice_app_order"."id" IN (~~~~~~~);
  12.  
  13. """
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top