Beispiel #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))
Beispiel #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))
Beispiel #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))
Beispiel #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))
Beispiel #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))
Beispiel #6
0
 def clean_by_name(cls, app_id, name):
     cache.delete(cls.PREFIX_NAME.format(app_id, name))
Beispiel #7
0
 def clean(cls, rid):
     cache.delete(cls.PREFIX_ID.format(rid))
Beispiel #8
0
 def clean(cls, app):
     cache.delete(cls.PREFIX_ID.format(app.id))
     cache.delete(cls.PREFIX_NAME.format(app.name))
Beispiel #9
0
 def clean(cls, key):
     cache.delete(cls.PREFIX_ID.format(key))
     cache.delete(cls.PREFIX_NAME.format(key))
Beispiel #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))
Beispiel #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))
Beispiel #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))
Beispiel #13
0
 def clean(cls, type_id, attr_id):
     cache.delete(cls.PREFIX_ID.format(type_id, attr_id))
Beispiel #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))
Beispiel #15
0
 def del_count_error(cls, key):
     cache.delete(cls.PREFIX_ERROR.format(key))