diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-10-16 12:10:17 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-10-16 12:10:17 +0200 |
commit | 397858e3dbe21488711c739028cc4803a37076d1 (patch) | |
tree | ad04d9e574e9d1523ae3b967fc781f0b9d2c3238 /ishtar_common/models.py | |
parent | 0049a4f8ad6e1dfa9a5086131a631267621d6058 (diff) | |
download | Ishtar-397858e3dbe21488711c739028cc4803a37076d1.tar.bz2 Ishtar-397858e3dbe21488711c739028cc4803a37076d1.zip |
Natural keys for operations, context records, finds, etc.
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 0eade6891..a73ba8155 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -441,6 +441,11 @@ def post_save_cache(sender, **kwargs): sender.refresh_cache() +class ExternalIdManager(models.Manager): + def get_by_natural_key(self, external_id): + return self.get(external_id=external_id) + + class SlugModelManager(models.Manager): def get_by_natural_key(self, slug): return self.get(slug=slug) |