django-sharding icon indicating copy to clipboard operation
django-sharding copied to clipboard

Bug in the docs

Open M1ha-Shvn opened this issue 7 years ago • 3 comments

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.

M1ha-Shvn avatar Dec 04 '17 08:12 M1ha-Shvn

And another one: http://josephkahn.io/django-sharding/docs/installation/Settings.html Additional Settings ReadOnlyFromPrimaryDatabases is really called PrimaryOnlyRoutingStrategy

M1ha-Shvn avatar Dec 04 '17 12:12 M1ha-Shvn

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

M1ha-Shvn avatar Dec 07 '17 11:12 M1ha-Shvn

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

M1ha-Shvn avatar Dec 12 '17 06:12 M1ha-Shvn