1

In tutorials (all over the place, since there is no official one), all kinds of places get suggested for placing notification.create_notice_type of django-notification, but wouldn't the most logical place be in a migration? Or is there a good reason not to do that?

Since it seems like such an obvious solution I'm a bit suprrised that it's nowhere (where I could find it) suggested, and therefore am afraid I might be missing a technicality.

ChrisF
  • 134,786
  • 31
  • 255
  • 325
markijbema
  • 3,985
  • 20
  • 32

1 Answers1

1

One objection that comes to mind is in the case of initial deployments, e.g. a new developer joins your team.

The most common way this is handled is to run syncdb --all and then fake the existing migrations. In cases like that, your notice type would not be created.

J.Spiral
  • 475
  • 5
  • 10
  • But then data-migrations wouldn't be run either. This hangs on the assumption that an empty database is the desirable blank slate, or that all initialization is done in fixtures (which are a pain imho, since they're not migrated). But good point, thx. – markijbema Dec 19 '11 at 11:06
  • you're right, and i'm not arguing for the correctness of that approach, it's just something i've noticed a number of django projects doing – J.Spiral Dec 20 '11 at 08:00