def get_user_prompts(user): query = UserPrompt.select().where( UserPrompt.user == user).join(UserPromptKind) return [prompt.kind.name for prompt in query]
def has_user_prompts(user): try: UserPrompt.select().where(UserPrompt.user == user).get() return True except UserPrompt.DoesNotExist: return False