Example #1
0
File: dj.py Project: hchapman/WBOR
  def username(self, username):
    username = username.strip()
    try:
      other = self.get_key_by_username(username)
      if as_key(other) != as_key(self.key):
        raise ModelError("There is already a Dj with this username", other)
    except NoSuchUsername:
      pass

    self.purge_own_username_cache()
    self.raw.username = username
Example #2
0
 def has_dj(self, dj):
   return dj is not None and as_key(dj) in self.dj_list
Example #3
0
 def set_all_cache(cls, key_set):
   return cls.cache_set(set([as_key(key) for key in key_set]), cls.ALL)