Mercurial > kallithea
comparison rhodecode/model/db.py @ 2016:6020e3884a58 beta
implements #212 moved default encoding variable into rhodecode-config. It's now possible to change
default utf8 to some other encoding.
- also added instance-id to config
- update ini files
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 22 Feb 2012 04:30:26 +0200 |
parents | 8530c3cd9d04 |
children | 82a88013a3fd fb51a6fc10ae |
comparison
equal
deleted
inserted
replaced
2015:5415d0de5970 | 2016:6020e3884a58 |
---|---|
1032 """ | 1032 """ |
1033 Wrapper for generating a key | 1033 Wrapper for generating a key |
1034 | 1034 |
1035 :param key: | 1035 :param key: |
1036 """ | 1036 """ |
1037 return "%s" % (key) | 1037 import rhodecode |
1038 prefix = '' | |
1039 iid = rhodecode.CONFIG.get('instance_id') | |
1040 if iid: | |
1041 prefix = iid | |
1042 return "%s%s" % (prefix, key) | |
1038 | 1043 |
1039 @classmethod | 1044 @classmethod |
1040 def get_by_key(cls, key): | 1045 def get_by_key(cls, key): |
1041 return cls.query().filter(cls.cache_key == key).scalar() | 1046 return cls.query().filter(cls.cache_key == key).scalar() |
1042 | 1047 |