def get_click_set(datetime_start,datetime_end,datetime_delta):
    act_date = datetime_start
    while act_date < datetime_end:
        end_date = min(datetime_end,act_date+datetime_delta);
        session = clickdb.get_pixel_db_session()
        andstatement = and_(Click.time_start>=act_date,Click.time_start<end_date)
        yield session.query(Click).filter(andstatement)
        act_date = act_date+datetime_delta;
Exemple #2
0
def ClicksWhichCorrespondToSessionsWithOneClick():
    sess = clickdb.get_clicksession_db_session()
    pix_sess = clickdb.get_pixel_db_session()
    qry = sess.query(ClickSession.firstclick).filter(and_(ClickSession.click_count==1,ClickSession.qualification_certainty==1)).limit(10)
    for cl in qry:
        print cl.firstclick
        cl_qry = pix_sess.query(Click).filter(Click.id==cl.firstclick).first()
        print cl_qry
        print "Ref {0} \n Time spent: {1}\n Url: {2}".format(cl_qry.ref,cl_qry.time_spent,cl_qry.url)
Exemple #3
0
def AllClicksFor(vis,pubid):
    pix_sess = clickdb.get_pixel_db_session()
    qry = pix_sess.query(Click).filter(and_(Click.visitor==vis,Click.public_id==pubid)).order_by(Click.time_start)
    print "All clicks for {0} {1} ==================================".format(vis,pubid)
    for click in qry:
        print click