News for hackers. Stuff that matters.
Re:Thoughts about Rails from a Django guy by technoweenie on Sunday July 25, 2010 @12:14PM (#1545760)
The difference between ActiveRecord and Django models, is ActiveRecord reads the schema. When you're developing, having an ORM create tables and add colums willy nilly is fine.

DataMapper took this approach initially, and was basically unusable in production because all it could do was create and drop tables. They've since added a handy upgrade method, and even ActiveRecord style migrations.

Personally, I like keeping the model and schema separate. I rarely need a giant list of columns at the top of my model. Luckily, Rails 3 will work great with DataMapper or Sequel (two fine alternatives to AR) if that's how you want to roll.

Re:Thoughts about Rails from a Django guy by hbien on Sunday July 25, 2010 @01:54PM (#1545963)
Just clarifying, Django models only create the initial tables/columns of a model after running the `syncdb` command. If you add fields later on, you'll need to write the SQL to add the columns yourself (http://code.djangoproject.com/wiki/SchemaEvolution). It won't try to be smart and automatically migrate your db for you.

I haven't used DataMapper in a few years, but I remember their initial approach was to be smart and automagically add/remove any required columns/tables willy nilly.

Re:Thoughts about Rails from a Django guy by bdr on Sunday July 25, 2010 @03:13PM (#1546118)
Just to clarify even more, you should be using South (http://south.aeracode.org/), the first thing on that list, and you usually don't have to write the SQL yourself.