Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'attributes': 0.07; 'postgresql': 0.07; 'prototypes': 0.07; 'sql.': 0.07; 'creighton': 0.09; 'hooks': 0.09; 'logic': 0.09; 'orm': 0.09; 'sql,': 0.09; 'sqlite': 0.09; 'python': 0.11; 'syntax': 0.13; 'do,': 0.15; '23,': 0.16; 'columns': 0.16; 'dummy': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'in-memory': 0.16; 'infinity': 0.16; 'message- id:@cskk.homeip.net': 0.16; 'received:211.29': 0.16; 'received:211.29.132': 0.16; 'received:cskk.homeip.net': 0.16; 'received:homeip.net': 0.16; 'received:optusnet.com.au': 0.16; 'received:syd.optusnet.com.au': 0.16; 'simpson': 0.16; 'sorts': 0.16; 'sqlalchemy': 0.16; 'stuff.': 0.16; 'throwaway': 0.16; 'uses,': 0.16; 'using,': 0.16; 'usual.': 0.16; 'wrote:': 0.16; 'laura': 0.18; 'why.': 0.18; ';-)': 0.18; 'tests': 0.18; '>>>': 0.20; 'saying': 0.22; 'lawrence': 0.22; 'am,': 0.23; '2015': 0.23; '(you': 0.23; 'errors': 0.23; 'sat,': 0.23; 'cheers,': 0.24; "haven't": 0.24; 'tried': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'reflect': 0.27; 'ride': 0.27; "i'm": 0.29; 'crash': 0.29; 'declared': 0.29; 'parent': 0.29; 'objects': 0.29; "i'd": 0.31; 'run': 0.32; 'core': 0.32; 'avoiding': 0.33; 'lets': 0.33; 'quotes': 0.33; 'received:com.au': 0.33; 'useful': 0.35; 'to:addr:python-list': 0.35; 'really': 0.35; 'but': 0.36; 'two': 0.37; "didn't": 0.37; 'subject:: ': 0.37; 'charset:us- ascii': 0.37; 'instead': 0.38; 'world,': 0.38; 'rather': 0.38; 'doing': 0.38; 'mean': 0.38; 'means': 0.39; 'things': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'sure': 0.40; 'some': 0.40; 'content-disposition:inline': 0.60; 'your': 0.60; 'relationship': 0.61; 'real': 0.61; 'strange': 0.63; 'great': 0.64; 'course': 0.64; 'different': 0.64; 'results': 0.66; 'cameron': 0.66; 'everybody': 0.67; 'risk': 0.67; 'foreign': 0.69; 'lack': 0.76; 'friends': 0.82; '>you': 0.84; 'child,': 0.84; 'dress': 0.84; 'pain': 0.84; 'subject:good': 0.84; 'subject:tool': 0.84; 'thing,': 0.93 Date: Sat, 23 May 2015 08:42:29 +1000 From: Cameron Simpson To: python-list@python.org Subject: Re: Camelot a good tool for me MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <87fv6ol93p.fsf@nautilus.nautilus> User-Agent: Mutt/1.5.23 (2014-03-12) References: <87fv6ol93p.fsf@nautilus.nautilus> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=QeFf4Krv c=1 sm=1 tr=0 a=rgDbx50tNA2z7xLXQOoruw==:117 a=rgDbx50tNA2z7xLXQOoruw==:17 a=ZtCCktOnAAAA:8 a=PO7r1zJSAAAA:8 a=J0QyKEt1u0cA:10 a=kj9zAlcOel0A:10 a=vrnE16BAAAAA:8 a=h1PgugrvaO0A:10 a=pGLkceISAAAA:8 a=tjoIZDSO95DATXs3yzoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 55 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1432459244 news.xs4all.nl 2882 [2001:888:2000:d::a6]:53578 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:91165 On 22May2015 21:12, Lele Gaifax wrote: >Chris Angelico writes: >> On Sat, May 23, 2015 at 3:24 AM, Lele Gaifax wrote: >>> Laura Creighton writes: >>>> In my corner of the world, everybody uses SQL. >>>> [...] >>>> The people who have tried SQLAlchemy really didn't like it, and of course >>>> the people who haven't tried it do what their friends do, as usual. >>> >>> If these sentences are related, you must live in a very strange corner! >>> ;-) > >> Not sure why. I'm in the same corner, I think - I use SQL, and not >> SQLAlchemy if I can help it. I'd much rather just use psycopg2 and do >> my own queries. > >Didn't mean to be so serious, but anyway... > >> SQLAlchemy has its uses, and it does solve a number of >> issues in reasonably clean ways, but I don't like a few of its facets, >> including its peculiar way of doing foreign key relationships. (You >> put a foreign key in the child, and you put a relationship in the >> parent, which feels backwards.) > >You are conflating two different layers, core and ORM. ORM relationships can >be declared either on the parent or on the child, it's up to your taste. Indeed. I'm a big fan of SQLAlchemy myself. But I do not use the ORM stuff. I like SQLAlchemy because: - it quotes for me, avoiding an infinity of pain and injection risk - it presents results as nice objects with attributes named after columns - it lets me write SQL queries as nice parameterised Python syntax instead of clunky SQL - it automatically hooks into various backends, which means I can write many tests or prototypes using, for example, in-memory SQLite dummy databases while still speaking to MySQL or PostgreSQL in the real world. (Obviously you need to run some tests against the real thing, but looking for SQL logic errors is readily tested against throwaway SQLite or the like.) I stay away from the ORM; I'm effectively writing SQL directly but using better syntax. I'm not saying the ORM is bad - you can clearly do all sorts of great things with it, but I have not found it useful to me, and that may reflect my ORM design skills and/or lack of experience with it. Cheers, Cameron Simpson Ride to not crash. Dress to crash. Live to ride to not crash again. - Lawrence Smith, DoD#i, lawrence@msc.cornell.edu