RubyonRails’ ActiveRecord vs. Django’s ORM

I’ve just recently started to explore Rails, Ruby and ActiveRecord.  There’s a lot to be said about the transparency of ActiveRecord, as it keeps your code relatively clean, and makes it very easy to quickly deploy database driven sites.

ActiveRecord supports inheritence but it requires that your parent table have a special column named “Type”.

Django’s ORM is deeply entangled with Django, which means it’s difficult to migrate, however it does NOT restrict you significantly on naming conventions – it simple builds tables according to classnames including their containing modules.

So if you django app is called “myapp” and you have a models.py with three different classes, “A”, “B”, and C”, your tables will be found as “myapp_a”, “myapp_b”, “myapp_c” respectively.

My recommendation is to use Rails to rapidly prototype your application, then migrate it to django.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.