Ejemplo n.º 1
0
def create_dudlr(user, name):
    """
    Create a new dudlr user
    """
    dudlr = Dudlr()
    dudlr.name = name
    dudlr.user = user
    dudlr.put()
Ejemplo n.º 2
0
def get_dudlr(user=None):
    """
    Get the dudlr associated with google user.

    @param user: C{User} object
    """
    user = user or users.get_current_user()
    if not user:
        return
    dudlr = Dudlr.all()
    dudlr.filter('user = ', user)
    dudlr = dudlr.get()
    if not dudlr:
        dudlr = Dudlr(user=user, name=user.nickname())
        dudlr.put()
    return dudlr