On Wed, Jun 12, 2013 at 07:59:01AM -0700, Pierre-Yves Chibon wrote:
> In fedocal/alembic/versions/2c5c36431061_add_the_meeting_date.py:
> 
> > @@ -18,7 +18,7 @@
> >  def upgrade():
> >      ''' Add the meeting_date_end column to the meetings table '''
> >      op.add_column('meetings', sa.Column('meeting_date_end', sa.Date,
> > -        default=datetime.utcnow().date()))
> > +                  default=datetime.utcnow().date()))
> 
> I do not see what's the advantage of the lambda, am I missing something?
> 
The current code sets the default for the column to a specific date: the one
when the field was defined.

Using the lambda would set the default to invoke the
datetime.utcnow().date() function everytime a new record was added.

Side notes:

* if lambda is what's desired utcnow() + timedelta:1 hour might
  be an even beter default.

* I'm not sure how sqlalchemy records python callable defaults in the db...
  what happens if someone adds a record to the database directly?  Does that
  bypass the default value?

-Toshio