Exemplo n.º 1
0
 def clean(cls, user):
     '''
     清除key
     '''
     cache.delete(cls.PREFIX_ID.format(user.id))
     cache.delete(cls.PREFIX_NAME.format(user.username))
     cache.delete(cls.PREFIX_NICK.format(user.nickname))
Exemplo n.º 2
0
 def clean(cls, key):
     ct = cls.get(key)
     if ct is not None:
         cache.delete("RelationType::Name::{0}".format(ct.name))
         cache.delete("RelationType::ID::{0}".format(ct.id))
Exemplo n.º 3
0
 def clean(cls, key):
     ct = cls.get(key)
     if ct is not None:
         cache.delete("CIType::Name::{0}".format(ct.name))
         cache.delete("CIType::ID::{0}".format(ct.id))
         cache.delete("CIType::Alias::{0}".format(ct.alias))
Exemplo n.º 4
0
 def clean(cls, attr):
     cache.delete('Field::ID::{0}'.format(attr.id))
     cache.delete('Field::Name::{0}'.format(attr.name))
     cache.delete('Field::Alias::{0}'.format(attr.alias))
Exemplo n.º 5
0
 def clean(cls, key):
     ci_type = CITypeCache.get(key)
     attrs = cls.get(key)
     if attrs is not None and ci_type:
         cache.delete("CITypeAttribute::ID::{0}".format(ci_type.id))
         cache.delete("CITypeAttribute::Name::{0}".format(ci_type.name))
Exemplo n.º 6
0
 def clean_by_name(cls, app_id, name):
     cache.delete(cls.PREFIX_NAME.format(app_id, name))
Exemplo n.º 7
0
 def clean(cls, rid):
     cache.delete(cls.PREFIX_ID.format(rid))
Exemplo n.º 8
0
 def clean(cls, app):
     cache.delete(cls.PREFIX_ID.format(app.id))
     cache.delete(cls.PREFIX_NAME.format(app.name))
Exemplo n.º 9
0
 def clean(cls, key):
     cache.delete(cls.PREFIX_ID.format(key))
     cache.delete(cls.PREFIX_NAME.format(key))
Exemplo n.º 10
0
 def clean(cls, rid):
     cache.delete(cls.PREFIX_PARENT.format(rid))
     cache.delete(cls.PREFIX_CHILDREN.format(rid))
     cache.delete(cls.PREFIX_RESOURCES.format(rid))
Exemplo n.º 11
0
 def clean(cls, key):
     ct = cls.get(key)
     if ct is not None:
         cache.delete(cls.PREFIX_NAME.format(ct.name))
         cache.delete(cls.PREFIX_ID.format(ct.id))
         cache.delete(cls.PREFIX_ALIAS.format(ct.alias))
Exemplo n.º 12
0
 def clean(cls, attr):
     cache.delete(cls.PREFIX_ID.format(attr.id))
     cache.delete(cls.PREFIX_NAME.format(attr.name))
     cache.delete(cls.PREFIX_ALIAS.format(attr.alias))
Exemplo n.º 13
0
 def clean(cls, type_id, attr_id):
     cache.delete(cls.PREFIX_ID.format(type_id, attr_id))
Exemplo n.º 14
0
 def clean(cls, key):
     ci_type = CITypeCache.get(key)
     attrs = cls.get(key)
     if attrs is not None and ci_type:
         cache.delete(cls.PREFIX_ID.format(ci_type.id))
         cache.delete(cls.PREFIX_NAME.format(ci_type.name))
Exemplo n.º 15
0
 def del_count_error(cls, key):
     cache.delete(cls.PREFIX_ERROR.format(key))