django-sharding
django-sharding copied to clipboard
Bug in the docs
https://github.com/JBKahn/django-sharding/blob/master/README.md
contains error in "Create Your First Sharded Model" section.
@model_config(sharded=True)
has no parameter sharded
in latest version of library.
And another one:
http://josephkahn.io/django-sharding/docs/installation/Settings.html
Additional Settings
ReadOnlyFromPrimaryDatabases
is really called PrimaryOnlyRoutingStrategy
http://josephkahn.io/django-sharding/docs/installation/Settings.html
DJANGO_FRAGMENTS_SHARD_SETTINGS
is DJANGO_SHARDING_SETTINGS
parameter in django.conf
See: https://github.com/JBKahn/django-sharding/blob/master/django_sharding/apps.py#L15
http://josephkahn.io/django-sharding/docs/usage/DataMigrations.html
def do_the_stuff(apps, schema_editor):
User = apps.get_model("auth", "User")
current_database = schema_editor.connection.alias
if is_model_class_on_database(model=User, database=database):
User.objects.using(database).update(password="*******")
Variable is called current_database at first, but used as database