From fa15d17e9a003b87240da667b7b248e660399394 Mon Sep 17 00:00:00 2001 From: craig Date: Tue, 22 Dec 2015 07:11:29 +1100 Subject: [PATCH] hack to not modify meteor --- dddp/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dddp/models.py b/dddp/models.py index 28c52e1..fb4f9b7 100644 --- a/dddp/models.py +++ b/dddp/models.py @@ -228,8 +228,12 @@ class AleaIdField(models.CharField): def get_seeded_value(self, instance): """Generate a syncronised value.""" # Django model._meta is public API -> pylint: disable=W0212 + if hasattr(instance, "meteor_collection"): + name = instance.meteor_collection + else: + name = instance._meta return meteor_random_id( - '/collection/%s' % instance._meta, self.max_length, + '/collection/%s' % name, self.max_length, ) def get_pk_value_on_save(self, instance):