summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
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
commit397858e3dbe21488711c739028cc4803a37076d1 (patch)
treead04d9e574e9d1523ae3b967fc781f0b9d2c3238 /ishtar_common/models.py
parent0049a4f8ad6e1dfa9a5086131a631267621d6058 (diff)
downloadIshtar-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.py5
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)