Permalink
Browse files

Raise (pending) deprecation warning for allow_syncdb.

  • Loading branch information...
1 parent 2085f53 commit 250841017c6c456806cadd214b4e130aa998233d @mjtamlyn mjtamlyn committed Feb 9, 2014
Showing with 4 additions and 0 deletions.
  1. +4 −0 django/db/utils.py
View
4 django/db/utils.py
@@ -268,6 +268,10 @@ def allow_migrate(self, db, model):
try:
method = router.allow_migrate
except AttributeError:
+ warnings.warn(
+ 'Router.allow_syncdb has been deprecated and will stop working in Django 1.9.'
+ 'Rename the method to allow_migrate.',
+ PendingDeprecationWarning, stacklevel=2)
method = router.allow_syncdb
except AttributeError:
# If the router doesn't have a method, skip to the next one.

3 comments on commit 2508410

@timgraham
Django member

Could you silence or fix these warnings when running the tests with -Wall?

/home/tim/code/django/tests/multiple_database/tests.py:1027: PendingDeprecationWarning: Router.allow_syncdb has been deprecated and will stop working in Django 1.9.Rename the method to allow_migrate.
  self.assertFalse(router.allow_migrate('default', User))
/home/tim/code/django/tests/multiple_database/tests.py:1028: PendingDeprecationWarning: Router.allow_syncdb has been deprecated and will stop working in Django 1.9.Rename the method to allow_migrate.
  self.assertTrue(router.allow_migrate('default', Book))
@alex
Django member

@timgraham @mjtamlyn I believe: http://bpaste.net/show/177298/ fixes teh issue correctly. If it looks ok, I'll go ahead and commit it?

@mjtamlyn
Django member

@alex Just pushed basically that d238ab2

Please sign in to comment.