Python ORMs Supporting POPOs and Substituting Layers in Django

Marco Nawijn nawijn at gmail.com
Sat Nov 5 16:35:55 EDT 2011


On Nov 5, 9:11 pm, Travis Parks <jehugalea... at gmail.com> wrote:
> Hello:
>
> A new guy showed up at work a few weeks ago and has started talking
> about replacing a 6 month old project, written in ASP.NET MVC, with an
> open source solution that can handle massive scaling. I think his
> primary concern is the "potential" need for massive web farms in the
> future. In order to prevent high licensing costs, I think he wants to
> move everything to open source technologies, such as the LAMP stack. I
> also don't think he truly understands what ASP.NET MVC is and thinks
> it is the older WebForms.
>
> I have been researching open source MVC frameworks and came across
> Django. It looks like an awesome tool, but I am willing to look at
> others. I have experience in Python (and enough in PHP to want to
> avoid it and absolutely none in Ruby) so I think it would be a good
> language to develop in.
>
> I was wondering if there were any ORMs for Python that used POPOs
> (plain old Python objects). There is a lot of business logic in my
> system, and so I want to keep my data objects simple and stupid. I
> want the ORM to be responsible for detecting changes to objects after
> I send them back to the data layer (rather than during business layer
> execution). Additionally, being a stateless environment, tracking
> objects' states isn't very useful anyway.
>
> Honestly, I doubt this guy is going to get his wish. The people paying
> for the application aren't going to be willing to throw 6 months of
> work down the drain. Never the less, I want to have plenty of research
> under my belt before being asked what my thoughts are. He was talking
> about using the Zend Framework with PHP, but I want to avoid that if
> possible. Django seems like one of the best MVC solutions in the
> Python arena. I would be willing to replace Django's ORM solution with
> something else, especially if it supported POPOs. I could even map all
> of the non-POPOs to POPOs if I needed to, I guess.
>
> Finally, I wanted to ask whether anyone has tried having Django call
> out to Python 3 routines. I am okay using Python 2.7 in Django, if I
> can have the controllers call business logic implemented in Python 3,
> accepting POPOs from the data layer. Django would really just be a
> coordinator: grab data from Django ORM, convert results into POPOs,
> load up Python 3 module with business logic, passing POPOs, returning
> POPOs and then converting those to view models. I'm sweating just
> thinking about it. My guess is that there would be a severe penalty
> for crossing process boundaries... but any insights would be
> appreciated.
>
> Thanks,
> Travis Parks

Hello Travis,

I am not an expert in the field,  but I have used SQLAlchemy
(www.sqlalchemy.org)
for a while and was very happy with it. It should be able to scale up
to pretty
complex applications and large amounts of data.

Regards,

Marco



More information about the Python-list mailing list