mitodl / ccxcon

CCXCon API
GNU Affero General Public License v3.0
7 stars 0 forks source link

Pull uuid lambda into new helper method. #59

Closed justinabrahms closed 8 years ago

justinabrahms commented 8 years ago

This allows django to serialize it for the purposes of migration generation.

noisecapella commented 8 years ago

This looks fine overall but can you explain what Django is doing that treats named functions differently from lambdas in this case (if you know)?

justinabrahms commented 8 years ago

https://docs.djangoproject.com/en/1.9/ref/models/fields/#default says that lambdas are incompatible with migrations. If you look at the resulting migration, it references it via import, which can't happen if it's a lambda.

noisecapella commented 8 years ago

Sounds good :+1: