Python ORMs Supporting POPOs and Substituting Layers in Django

Lie Ryan lie.1296 at gmail.com
Tue Nov 8 00:09:56 EST 2011


On 11/08/2011 01:21 PM, Travis Parks wrote:
> On Nov 7, 12:44 pm, John Gordon<gor... at panix.com>  wrote:
>> In<j98tnf$qh... at reader1.panix.com>  John Gordon<gor... at panix.com>  writes:
>>
>>> In<415d875d-bc6d-4e69-bcf8-39754b450... at n18g2000vbv.googlegroups.com>  Travis Parks<jehugalea... at gmail.com>  writes:
>>>> Which web frameworks have people here used and which have they found
>>>> to be: scalable, RAD compatible, performant, stable and/or providing
>>>> good community support? I am really trying to get as much feedback as
>>> I've used Django and it seems to be a very nice framework.  However I've
>>> only done one project so I haven't delved too deeply.
>>
>> You are probably looking for more detail than "It's a nice framework" :-)
>>
>> The database model in Django is powerful; it allows you to do queries in
>> native Python code without delving into backend SQL stuff.
>>
>> I don't know how scalable/performant the database model is, as the one
>> project I worked on didn't deal with a ton of data.  (But I'd be surprised
>> if it had poor performance.)
>>
>> The URL dispatcher provides a very nice and logical way to associate a
>> given URL with a given method call.
>>
>> Community support is excellent.
>>
>> --
>> John Gordon                   A is for Amy, who fell down the stairs
>> gor... at panix.com              B is for Basil, assaulted by bears
>>                                  -- Edward Gorey, "The Gashlycrumb Tinies"
>
> I started the battle today. The "new guy" was trying to sell me on
> CodeIgnitor. I haven't looked at it, but it is PHP, so I really want
> to avoid it. The good thing is that all of his "friends" have been
> telling him to get into Python. I have been trying to convince him
> that PHP isn't cut out for background services and is mostly a front-
> end language. Python is much more geared towards hardcore data
> processing. Why write the system in two languages?
>
> I have been spending a lot of time looking at the Pyramid project: the
> next generation of the Pylons project. It looks powerful, but it seems
> to be a lot more complex than Django.

CodeIgniter is a very fine framework, however it builds on top of a 
shitty excuse of a language called PHP.

I've found that Django has a much better debugging tools; when a Django 
page produces an exception, it would always produce a useful error page. 
I haven't been able to do the same in CodeIgniter (nor in any PHP 
framework I've used, I'm starting to think it's a language limitation); 
often when you have errors, PHP would just silently return empty or 
partial pages even with all the debugging flags on.

IMO, Python has a much nicer choice of built-in data structure for data 
processing. Python has a much more mature object-orientation, e.g. I 
prefer writing l.append(x) rather than array_push(l, x). I think these 
qualities are what makes you think Python is much, much more suitable 
for data processing than PHP; and I wholesomely agree.

Database abstraction-wise, Django's ORM wins hands down against 
CodeIgniter's ActiveRecord. CodeIgniter's ActiveRecord is basically just 
a thin wrapper that abstracts the perks of various database engine. 
Django's ORM is a full blown ORM, it handles foreign key relationships 
in OO way. The only disadvantage of Django's ORM is that since it's 
written in Python, if you need to write a program working on the same 
database that doesn't use Django nor Python, then you'll have a problem 
since you'll have to duplicate the foreign key relationships.

With all the bashing of PHP, PHP do have a few advantages. PHP and 
CodeIgniter is much easier to set up and running than Django; and the 
ability to create a .php file and have it running without having to 
write the routing file is sometimes a bliss. And PHP are often used as 
their own templating language; in contrast with Django which uses a 
separate templating language. Having a full blown language as your 
templating language can be a double-edged sword, but it is useful 
nevertheless for experimental work.

IMO, while it is easier to get up and running in PHP, in the long run 
Python is much better in almost any other aspects.




More information about the Python-list mailing list