コード例 #1
0
def demo():
    demoID = '513a07ec9c7c840007acfc52' #me!
    posts = Track.objects(author=demoID)
    analysis = Analysis.objects(author=demoID).first()
    return render_template("demo.html", 
        title = 'Demo',
        posts = posts,
        analysis = analysis)
コード例 #2
0
ファイル: workgroup.py プロジェクト: lucassimon994/ClinApp
def ProcessJob(token):
    """
    Processes a job into a json document, which is returned. If there are any 
    errors, it will return False.
    """
    job = Analysis.objects(analysis_token=token)[0]
    CountAlleles(job)
    schema = GenerateSchema(job)
    return FixSchema(schema)
コード例 #3
0
def user(name):
    user = User.objects(name = name).first()
    if user == None:
        flash('User ' + name + ' not found.')
        return redirect(url_for('index'))
    if g.user == user:
        posts = Track.objects(author=user)
        analysis = Analysis.objects(author=g.user).first()
        return render_template('user.html',
            user = user, 
            posts = posts,
        analysis = analysis)
    flash('You can only look at your own profile.')
    return redirect(url_for('index'))
コード例 #4
0
def index():
    form = TrackForm()
    if form.validate_on_submit():
        tracking = Track (
                weight = form.weight.data,
                happy = form.happy.data,
                diet = form.diet.data,
                exercise = form.exercise.data,
                floss = form.floss.data,
                meditation = form.meditation.data,
                note = form.note.data,
                timestamp = datetime.utcnow(),
                author = g.user.to_dbref())
        tracking.save()
        flash('Your post is now live!')
        calculate_weightAvg_async(g.user.to_dbref())
        return redirect(url_for('index'))
    posts = Track.objects(author=g.user)
    analysis = Analysis.objects(author=g.user).first()
    return render_template("index.html", 
        title = 'Home',
        form = form,
        posts = posts,
        analysis = analysis)