예제 #1
0
파일: handlers.py 프로젝트: WentaoXu/newebe
    def get(self, startKey=None):
        '''
        Return activities by pack of LIMIT at JSON format. If a start key
        is given in URL (it means a date like 2010-10-05-12-30-48),
        activities until this date are returned. Else latest activities are
        returned.

        Arguments:
            *startKey* The date until where activities should be returned.
        '''


        if startKey:
            dateString = date_util.get_db_utc_date_from_url_date(startKey)
            docs = ActivityManager.get_all(startKey=dateString, tag="all")
        else:
            docs = ActivityManager.get_all()

        for doc in docs:
            try:
                subdoc = Activity.get_db().get(doc.docId)
                doc.subdoc = subdoc
            except:
                pass

        self.return_documents(docs)
예제 #2
0
파일: handlers.py 프로젝트: mpmedia/newebe
    def get(self, startKey=None):
        '''
        Returns last posted pictures.  If *startKey* is provided, it returns
        last picture posted until *startKey*.
        '''

        get_doc = PictureManager.get_last_pictures
        if startKey:
            dateString = date_util.get_db_utc_date_from_url_date(startKey)
            docs = get_doc(dateString)
        else:
            docs = get_doc()

        self.render("templates/picture_rows.html", pictures=docs)
예제 #3
0
    def get(self, startKey=None):
        '''
        Returns last posted commons.  If *startKey* is provided, it returns
        last common posted until *startKey*.
        '''

        get_doc = CommonManager.get_last_commons
        if startKey:
            dateString = date_util.get_db_utc_date_from_url_date(startKey)
            docs = get_doc(dateString)
        else:
            docs = get_doc()

        self.render("templates/common_rows.html", commons=docs)
예제 #4
0
    def get(self, startKey=None):
        '''
        Returns last posted commons.  If *startKey* is provided, it returns
        last common posted until *startKey*.
        '''

        get_doc = CommonManager.get_last_commons
        if startKey:
            dateString = date_util.get_db_utc_date_from_url_date(startKey)
            docs = get_doc(dateString)
        else:
            docs = get_doc()

        self.render("templates/common_rows.html", commons=docs)
예제 #5
0
파일: handlers.py 프로젝트: rakoo/newebe
    def return_documents_since(self, get_doc, startKey):
        '''
        Use the get doc function that takes a date converted from startKey
        (startKey must be an url date or null) as parameter to send
        desired documents to client.

        Return documents by pack at JSON format. If a start key 
        is given in URL (it means a date like 2010-10-05-12-30-48), 
        documents until this date are returned. Else latest documents are 
        returned.
        '''

        if startKey:
            dateString = date_util.get_db_utc_date_from_url_date(startKey)
            docs = get_doc(dateString)
        else:
            docs = get_doc()

        self.return_documents(docs)
예제 #6
0
    def return_documents_since(self, get_doc, startKey, tag=None):
        '''
        Use the get doc function that takes a date converted from startKey
        (startKey must be an url date or null) as parameter to send
        desired documents to client.

        Return documents by pack at JSON format. If a start key
        is given in URL (it means a date like 2010-10-05-12-30-48),
        documents until this date are returned. Else latest documents are
        returned.
        '''

        if startKey:
            dateString = date_util.get_db_utc_date_from_url_date(startKey)
            docs = get_doc(startKey=dateString, tag=tag)
        else:
            docs = get_doc()

        self.return_documents(docs)
예제 #7
0
    def get(self, startKey=None):
        '''
        Return activities by pack of LIMIT at JSON format. If a start key
        is given in URL (it means a date like 2010-10-05-12-30-48),
        activities until this date are returned. Else latest activities are
        returned.

        Arguments:
            *startKey* The date until where activities should be returned.
        '''
        if startKey:
            dateString = date_util.get_db_utc_date_from_url_date(startKey)
            docs = ActivityManager.get_all(startKey=dateString, tag="all")
        else:
            docs = ActivityManager.get_all()

        for doc in docs:
            try:
                subdoc = Activity.get_db().get(doc.docId)
                doc.subdoc = subdoc
            except:
                pass

        self.return_documents(docs)
예제 #8
0
def when_i_convert_url_date_2011_02_01_13_45_32_to_utc_date(step, urlDate):
    world.date = date_util.get_db_utc_date_from_url_date(urlDate)
    world.date = date_util.get_date_from_db_date(world.date)
예제 #9
0
파일: steps.py 프로젝트: HeartbliT/IReVeAI
def when_i_convert_url_date_2011_02_01_13_45_32_to_utc_date(step, urlDate):
    world.date = date_util.get_db_utc_date_from_url_date(urlDate)
    world.date = date_util.get_date_from_db_date(world.date)