示例#1
0
 def put(self):
   """Overridden method to ensure name is kept unique."""
   for group in UserGroup.all().filter('name = ', self.name):
     if not self.is_saved() or group.key() != self.key():
       raise db.BadValueError('There is already a group named "%s"'
                              % self.name)
   super(UserGroup, self).put()
   utility.clear_memcache()
示例#2
0
 def put(self):
   """Overridden method to ensure name is kept unique."""
   for group in UserGroup.all().filter('name = ', self.name):
     if not self.is_saved() or group.key() != self.key():
       raise db.BadValueError('There is already a group named "%s"'
                              % self.name)
   super(UserGroup, self).put()
   utility.clear_memcache()
示例#3
0
文件: admin.py 项目: pjesi/volta
def flush_memcache_info(_request):
    """Flushes the memcache.

  Args:
    _request: The request object (ignored)

  Returns:
    A Django HttpResponse object.

  """
    utility.clear_memcache()
    return http.HttpResponseRedirect(urlresolvers.reverse("views.admin.display_memcache_info"))
def flush_memcache_info(_request):
  """Flushes the memcache.

  Args:
    _request: The request object (ignored)

  Returns:
    A Django HttpResponse object.

  """
  utility.clear_memcache()
  return http.HttpResponseRedirect(
      urlresolvers.reverse('views.admin.display_memcache_info'))
示例#5
0
 def put(self):
   """Saves the profile and flushes the memcache."""
   super(UserProfile, self).put()
   utility.clear_memcache()
示例#6
0
 def delete(self):
   """Overridden method to clean up ACLs and to flush the memcache."""
   if self.acl_data:
     self.acl_data.delete()
   super(File, self).delete()
   utility.clear_memcache()
示例#7
0
 def put(self):
   """Overridden method to flush the memcache."""
   if self.acl_data:
     self.acl_data.put()
   super(File, self).put()
   utility.clear_memcache()
示例#8
0
文件: models.py 项目: pjesi/volta
 def delete(self):
   """Overridden to ensure memcache is cleared."""
   super(Template, self).delete()
   utility.clear_memcache()
  file_record = page.get_attachment(file_name)

  if not file_record:
    file_record = models.FileStore(name=file_name, parent_page=page)

  if file_data:
    file_record.data = db.Blob(file_data)
  elif url:
    file_record.url = db.Link(url)

  # Determine whether to list the file when the page is viewed
  file_record.is_hidden = 'hidden' in request.POST

  file_record.put()
  utility.clear_memcache()

  return utility.edit_updated_page(page_id, tab_name='files')


def delete_file(request, page_id, file_id):
  """Removes a specified file from the database.

  Args:
    request: The request object
    page_id: ID of the page the file is attached to.
    file_id: Id of the file.

  Returns:
    A Django HttpResponse object.
示例#10
0
 def put(self):
   """Saves the sidebar and flushes the memcache."""
   self.__try_parse()
   super(Sidebar, self).put()
   utility.clear_memcache()
示例#11
0
 def delete(self):
   """Overridden to ensure memcache is cleared."""
   super(UserGroup, self).delete()
   utility.clear_memcache()
示例#12
0
 def put(self):
   """Saves the profile and flushes the memcache."""
   super(UserProfile, self).put()
   utility.clear_memcache()
示例#13
0
 def delete(self):
   """Overridden method to clean up ACLs and to flush the memcache."""
   if self.acl_data:
     self.acl_data.delete()
   super(File, self).delete()
   utility.clear_memcache()
示例#14
0
 def put(self):
   """Overridden method to flush the memcache."""
   if self.acl_data:
     self.acl_data.put()
   super(File, self).put()
   utility.clear_memcache()
示例#15
0
 def delete(self):
   """Overridden to ensure memcache is cleared."""
   super(UserGroup, self).delete()
   utility.clear_memcache()
示例#16
0
 def put(self):
   """Saves the ACL and flushes the memcache."""
   super(AccessControlList, self).put()
   utility.clear_memcache()
示例#17
0
 def put(self):
   """Saves the ACL and flushes the memcache."""
   super(AccessControlList, self).put()
   utility.clear_memcache()
示例#18
0
  file_record = page.get_attachment(file_name)

  if not file_record:
    file_record = models.FileStore(name=file_name, parent_page=page)

  if file_data:
    file_record.data = db.Blob(file_data)
  elif url:
    file_record.url = db.Link(url)

  # Determine whether to list the file when the page is viewed
  file_record.is_hidden = 'hidden' in request.POST

  file_record.put()
  utility.clear_memcache()

  return utility.edit_updated_page(page_id, tab_name='files')


def delete_file(request, page_id, file_id):
  """Removes a specified file from the database.

  Args:
    request: The request object
    page_id: ID of the page the file is attached to.
    file_id: Id of the file.

  Returns:
    A Django HttpResponse object.
示例#19
0
 def put(self):
   """Saves the sidebar and flushes the memcache."""
   self.__try_parse()
   super(Sidebar, self).put()
   utility.clear_memcache()