Exemplo n.º 1
0
def check(gid):
    json = request.get_json()
    g = Group.get_one_by(group_id=gid)
    print('!!check json', json)
    u = current_user()
    result_id = Todo.toggleTodoGroup(json, u, g)
    return result_id
Exemplo n.º 2
0
def add(gid):
    form = request.form
    print('!!tag add form', form)
    u = current_user()
    g = Group.get_one_by(group_id=gid)
    t = Tag.inserTag(form, u, g)
    return t
Exemplo n.º 3
0
def add(gid):
    form = request.form
    print('!!note add form', form)
    u = current_user()
    g = Group.get_one_by(group_id=gid)
    t = Note.inserNote(form, u, g)
    return t
Exemplo n.º 4
0
def add(gid):
    form = request.form
    print('!!project add form', form)
    # ImmutableMultiDict([('title', '的撒发射点法大师傅大师傅')])
    u = current_user()
    g = Group.get_one_by(group_id=gid)

    t = Project.inserProject(form, u, g)
    return t
Exemplo n.º 5
0
def add(gid):
    form = request.form
    print('!!add form', form)
    # ImmutableMultiDict([('title', '的撒发射点法大师傅大师傅')])
    u = current_user()
    # u代表user
    g = Group.get_one_by(group_id=gid)
    t = Todo.inserTodo(form, u, g)
    s = '.' + gid
    return redirect(url_for(".index", gid=gid))
Exemplo n.º 6
0
def all(gid):
    u = current_user()
    gu = Group.get_one_by(group_id=gid).users
    list = []
    for g in gu:
        t = dict(
            name=g.name,
            icon=g.icon,
            email=g.email
        )
        list.append(t)
    print(list)
    return json.dumps(list)
Exemplo n.º 7
0
def all(gid):
    u = current_user()
    gu = Group.get_one_by(group_id=gid).users
    list = []
    for g in gu:
        t = dict(name=g.name,
                 icon=g.icon,
                 email=g.email,
                 performance=g.performance)
        list.append(t)

    def takep(u):
        return u['performance']

    list.sort(key=takep, reverse=True)  # 降序
    print(list)
    return json.dumps(list)
Exemplo n.º 8
0
def index(gid):
    u = current_user()
    g = Group.get_one_by(group_id=gid)
    print(g)
    return render_template("g_performance.html", user=u, group=g)
Exemplo n.º 9
0
def all(gid):
    g = Group.get_one_by(group_id=gid)
    t_list = Todo.getAll(None, g)
    return (t_list)
Exemplo n.º 10
0
def all(gid):
    u = current_user()
    g = Group.get_one_by(group_id=gid)
    print(g)
    list = Tag.getAll(None, g)
    return (list)
Exemplo n.º 11
0
def all(gid):
    u=current_user()
    g = Group.get_one_by(group_id=gid)
    list = Note.getAll(None, g)
    return (list)