Ejemplo n.º 1
0
  def __init__(self):
    self.name = 'memcache'
    self.client = None

    for cache_entry in all_cache_entries():
      if cache_entry.cache_type is self.name:
        self.supported_resources[cache_entry.model_plural]=cache_entry.class_name
        self.memcache_client = memcache.Client()
Ejemplo n.º 2
0
  def __init__(self):
    self.name = 'memcache'
    self.client = None

    for cache_entry in all_cache_entries():
      if cache_entry.cache_type is self.name:
        self.supported_resources[cache_entry.model_plural]=cache_entry.class_name
        self.memcache_client = memcache.Client()
Ejemplo n.º 3
0
    def __init__(self):
        self.name = 'local'

        for cache_entry in all_cache_entries():
            if cache_entry.cache_type is self.name:
                self.supported_resources[cache_entry.model_plural] = \
                    cache_entry.class_name

        for key in self.supported_resources.keys():
            self.cache_entries['collection:' + key] = {}
Ejemplo n.º 4
0
  def __init__(self):
    self.name = 'local'

    for cache_entry in all_cache_entries():
      if cache_entry.cache_type is self.name:
        self.supported_resources[cache_entry.model_plural] = \
            cache_entry.class_name

    for key in self.supported_resources.keys():
      self.cache_entries['collection:' + key] = {}
Ejemplo n.º 5
0
  def initialize(self, cache):
    """Initialize Cache Manager, configure cache mechanism."""
    self.supported_classes = {}
    for cache_entry in all_cache_entries():
      self.supported_classes[cache_entry.class_name] = cache_entry.model_plural

    self.supported_mappings = {}
    for mapping_entry in all_mapping_entries():
      self.supported_mappings.setdefault(mapping_entry.class_name, [])
      self.supported_mappings[mapping_entry.class_name].append(mapping_entry)

    self.cache_object = cache

    self.new = {}
    self.dirty = {}
    self.deleted = {}
    self.marked_for_add = {}
    self.marked_for_update = {}
    self.marked_for_delete = []
Ejemplo n.º 6
0
    def initialize(self, cache):
        """Initialize Cache Manager, configure cache mechanism."""
        self.supported_classes = {}
        for cache_entry in all_cache_entries():
            self.supported_classes[
                cache_entry.class_name] = cache_entry.model_plural

        self.supported_mappings = {}
        for mapping_entry in all_mapping_entries():
            self.supported_mappings.setdefault(mapping_entry.class_name, [])
            self.supported_mappings[mapping_entry.class_name].append(
                mapping_entry)

        self.cache_object = cache

        self.new = {}
        self.dirty = {}
        self.deleted = {}
        self.marked_for_add = {}
        self.marked_for_update = {}
        self.marked_for_delete = []