Exemplo n.º 1
0
 def get_character(self, character):
     '''Gets a character from the database by name.
     Returns the Character object, or False if it isn't a
     well-formed character object.'''
     try:
         charobj = Character.objects(name=character).first()
         return charobj if charobj.states else False
     except(IndexError, AttributeError):
         return False
Exemplo n.º 2
0
 def is_owner(self, username, character):
     charobj = Character.objects(name=character).first()
     if charobj:
         return charobj.owner == username
     else:
         return None