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 | 5aa11c751acecb6d5a3a56f45f74d17d64a358d1 (patch) | |
tree | ad04d9e574e9d1523ae3b967fc781f0b9d2c3238 /ishtar_common | |
parent | b6f5261620d6518a0e5a9da1e638ab97be716609 (diff) | |
download | Ishtar-5aa11c751acecb6d5a3a56f45f74d17d64a358d1.tar.bz2 Ishtar-5aa11c751acecb6d5a3a56f45f74d17d64a358d1.zip |
Natural keys for operations, context records, finds, etc.
Diffstat (limited to 'ishtar_common')
-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) |