Why I Hate Django - Part 2/2
-
Upload
cal-henderson -
Category
Business
-
view
6.196 -
download
8
description
Transcript of Why I Hate Django - Part 2/2
DjangoCon 2008 139
>>> from django.db import connection
>>> connection.queries
[{'sql': 'SELECT
polls_polls.id,polls_polls.question,polls_
polls.pub_date FROM polls_polls', 'time':
'0.002'}]
DjangoCon 2008 140
>>> from django.db import connection
>>> connection.queries
[{'sql': 'SELECT
polls_polls.id,polls_polls.question,polls_
polls.pub_date FROM polls_polls', 'time':
'0.002'}]
Not good enough!
DjangoCon 2008 151
SELECT `app_userprofile`.`user_id`,`app_userprofile`.`account_status`,`app_userprofile`.`account_status_reason`,`app_userprofile`.`account_delete_type`,`app_userprofile`.`syndication_key`,`app_userprofile`.`blurb`,`app_userprofile`.`location`,`app_userprofile`.`country`,`app_userprofile`.`postal_code`,`app_userprofile`.`gender`,`app_userprofile`.`theme`,`app_userprofile`.`tiny_photo`,`app_userprofile`.`small_photo`,`app_userprofile`.`smedium_photo`,`app_userprofile`.`medium_photo`,`app_userprofile`.`large_photo`,`app_userprofile`.`orig_photo`,`app_userprofile`.`bday_month`,`app_userprofile`.`bday_day`,`app_userprofile`.`bday_year`,`app_userprofile`.`is_pro`,`app_userprofile`.`privacy_settings_id`,`app_userprofile`.`email_settings_id`,`app_userprofile`.`preference_settings_id`,`app_userprofile`.`ad_counter`,`app_userprofile`.`num_friends`,`app_userprofile`.`num_fans`,`app_userprofile`.`num_feeds`,`app_userprofile`.`num_blocked_fans`,`app_userprofile`.`num_friend_requests`,`app_userprofile`.`default_set_id`,`app_userprofile`.`invite_id`,`app_userprofile`.`invite_round`,`app_userprofile`.`avail_invites`,`app_userprofile`.`original_email` FROM `app_userprofile` WHERE (`app_userprofile`.`user_id` = 1)
Unreadable SQL
DjangoCon 2008 154
SELECT `app_note`.`id`,`app_note`.`type`,`app_note`.`body`,`app_note`.`sender_id`,`app_note`.`date_sent`,`app_note`.`num_recipients`,`app_note`.`recipient_type`,`app_note`.`set_id`,`app_note`.`direct_to_id`,`app_note`.`media_file_id`,`app_note`.`url`,`app_note`.`url_inline`,`app_note`.`url_clicks`,`app_note`.`embed_id`,`app_note`.`event_id`,`app_note`.`is_direct`,`app_note`.`is_public`,`app_note`.`is_deleted`,`app_note`.`is_ad`,`app_note`.`reply_to_id`,`app_note`.`forwarded_from_id`,`app_note`.`original_note_id`,`app_note`.`stars`,`app_note`.`rsvp` FROM `app_note` LEFT OUTER JOIN `app_userprofile_notes` AS `m2m_app_note__recipients` ON `app_note`.`id` = `m2m_app_note__recipients`.`note_id` WHERE ((NOT (`app_note`.`is_deleted` = True)) AND `m2m_app_note__recipients`.`userprofile_id` = 17573) ORDER BY `app_note`.`date_sent` DESC LIMIT 16
Unreadable SQL
DjangoCon 2008 155
SELECT
n.*
FROM
app_note AS n
LEFT OUTER JOIN app_userprofile_notes AS l
ON
n.id=l.note_id
WHERE
n.is_deleted = False AND l.userprofile_id=17573
ORDER BY
n.date_sent DESC
LIMIT 16
Unreadable SQL
DjangoCon 2008 182
Photo credits• flickr.com/photos/wilson/18685396/• flickr.com/photos/uhop/105063089/• flickr.com/photos/plasticbag/91453376/• flickr.com/photos/zenoc/1408162618/• flickr.com/photos/subinev/27810058/• flickr.com/photos/kaptainkobold/2531797176/• flickr.com/photos/esti/243781036/• flickr.com/photos/oneras/253617128/• flickr.com/photos/josefstuefer/72512671/• flickr.com/photos/pgoyette/168076182/• flickr.com/photos/paulhammond/2825869449/• flickr.com/photos/nez/378348754/• flickr.com/photos/calevans/2265863104/• flickr.com/photos/mbiddulph/416190643/• flickr.com/photos/obliterated/2249663391/• flickr.com/photos/salim/67753003/• flickr.com/photos/sosalem/2816909110/• flickr.com/photos/radiorover/324193883/• flickr.com/photos/nickwheeleroz/2773776799/• flickr.com/photos/rse/22972901/• flickr.com/photos/rougerouge/534615363/• flickr.com/photos/hawkexpress/386355092/• flickr.com/photos/escalla/438817719/• flickr.com/photos/mknightphoto/2295688304/• flickr.com/photos/petereed/138369750/
• flickr.com/photos/sharynmorrow/2571566304/• flickr.com/photos/florathexplora/286035943/• flickr.com/photos/webguru4god/2233500779/• flickr.com/photos/emdot/195189924/• flickr.com/photos/kayepants/391645870/• flickr.com/photos/ppowers/793939285/• flickr.com/photos/dinesh_valke/425540358/• flickr.com/photos/hawkexpress/306276212/• flickr.com/photos/cedric1981/383614033/• flickr.com/photos/macspite/1118042091/• flickr.com/photos/jpstanley/1440357613/• flickr.com/photos/ashclements/248887492/• flickr.com/photos/kecko/1876479840/• flickr.com/photos/difusa/131100622/• flickr.com/photos/amagill/378984660/• flickr.com/photos/bea_k63w-wa/2466009108/• flickr.com/photos/namullim/2096115820/• flickr.com/photos/lotterymonkey/175248733/• flickr.com/photos/13519089@N03/1380483002/• flickr.com/photos/gswj/10344097/• flickr.com/photos/deanj/67607256/• flickr.com/photos/malias/2218694639/• flickr.com/photos/clintjcl/120760767/• flickr.com/photos/grandpamikey/2228239585/• flickr.com/photos/lea/2829752510/• flickr.com/photos/superamit/196481424/
DjangoCon 2008 183
More photo credits• flickr.com/photos/simon999/2419051858/• flickr.com/photos/tonyjcase/2172060723/• flickr.com/photos/heypaul/1428681/• flickr.com/photos/swisscan/2308034084/• flickr.com/photos/apollonia666/310793656/• flickr.com/photos/bdorfman/15846725/• flickr.com/photos/wishymom/566394520/• flickr.com/photos/jgarber/121886004/• flickr.com/photos/eole/380316678/• flickr.com/photos/917press/1940509163/• flickr.com/photos/wallyg/476718069/• flickr.com/photos/biwook/390088839/• flickr.com/photos/bdjsb7/1674027307/• flickr.com/photos/naveenroy/314965221/• flickr.com/photos/wyldkyss/2757474674/• flickr.com/photos/orinrobertjohn/409812627/• flickr.com/photos/candiedwomanire/1651870/• flickr.com/photos/dalvenjah/408497650/• flickr.com/photos/krikit/2657457178/• flickr.com/photos/w5nyv/2370344/• flickr.com/photos/jordanfischer/72510316/• flickr.com/photos/tedsblog/91531710/• flickr.com/photos/celesterc/1069893367/• flickr.com/photos/spacematters/766372252/• flickr.com/photos/esti/147733640/• flickr.com/photos/rbp/2833593771/
• flickr.com/photos/jordanroher/228435564/• flickr.com/photos/tambako/2524829095/• flickr.com/photos/66132721@N00/2725908636/• flickr.com/photos/freeparking/1279927021/• flickr.com/photos/drurydrama/1352506223/• flickr.com/photos/mn_francis/397620193/• flickr.com/photos/dramaqueennorma/273371415/• flickr.com/photos/chasqui/2338990305/• flickr.com/photos/cityhunter12/2574288725/• flickr.com/photos/akbuthod/1508537255/• flickr.com/photos/nunoforos/2811186142/• flickr.com/photos/marcusjb/432600086/• flickr.com/photos/12495774@N02/2405297371/• flickr.com/photos/larimdame/572477975/• flickr.com/photos/harryharris/1525946537/• flickr.com/photos/davemorris/91808851/• flickr.com/photos/aplumb/121285138/• flickr.com/photos/peebot/825451566/• flickr.com/photos/reillyb/2216541900/• flickr.com/photos/steffe/423086866/• flickr.com/photos/ciordia/255983919/• flickr.com/photos/wwworks/2472230611/• flickr.com/photos/pnoid00/1909096140/• flickr.com/photos/jurvetson/2229899/• flickr.com/photos/foxypar4/766801643/• flickr.com/photos/wizardhere/2413404079/