Beispiel #1
0
def index():
    #page = request.args.get('page')

    q = Dataset.get_all_admin().all()

    returnset = []
    for theobj in q:
        returnset.append(theobj)

    # if len(fields) < 1 and not getsources:
    #     return jsonify(q)
    
    # returnset = []
    # for obj in q:
    #     tempobj = {} 
    #     if len(fields) >0:
    #         for field in fields:
    #             tempobj[field] = getattr(obj, field)
    #     else:
    #         tempobj = obj.as_dict()
    #     if getsources:
    #         tempobj['sources'] = obj.sources.all()
    #     returnset.append(tempobj) 


    # TODO: Facets for territories and languages
    # TODO: filters on facet dimensions
    #maybe put the pager back in
    # print q
    # pager = Pager(q)
    return jsonify(returnset)
Beispiel #2
0
def index():
    #page = request.args.get('page')

    q = Dataset.get_all_admin().all()

    returnset = []
    for theobj in q:
        returnset.append(theobj)

    # if len(fields) < 1 and not getsources:
    #     return jsonify(q)

    # returnset = []
    # for obj in q:
    #     tempobj = {}
    #     if len(fields) >0:
    #         for field in fields:
    #             tempobj[field] = getattr(obj, field)
    #     else:
    #         tempobj = obj.as_dict()
    #     if getsources:
    #         tempobj['sources'] = obj.sources.all()
    #     returnset.append(tempobj)

    # TODO: Facets for territories and languages
    # TODO: filters on facet dimensions
    #maybe put the pager back in
    # print q
    # pager = Pager(q)
    return jsonify(returnset, headers={'Cache-Control': 'no-cache'})