示例#1
0
文件: views.py 项目: alexrpagan/doit
def source_data(req, dbname, sid):
    db = DoitDB(dbname)
    data = {
        'fields': db.source_fields(sid),
        'entities': db.source_entities(sid, 10)
    }
    return HttpResponse(simplejson.dumps(data), mimetype='application/json')
示例#2
0
def source_table(req, dbname, sid):
    db = DoitDB(dbname)
    fields = db.source_fields(sid)
    entities = db.source_entities(sid, 10)
    for entity in entities:
        vals = []
        for field in fields:
            try:
                vals.append(entity['fields'][field['id']])
            except KeyError:
                vals.append('')
            if vals[-1] is None: vals[-1] = ''
        entity['fields'] = vals
    return render_to_response('doit/viewTable_template.html', {
                'fields': fields, 'entities': entities})
示例#3
0
文件: views.py 项目: alexrpagan/doit
def source_data(req, dbname, sid):
    db = DoitDB(dbname)
    data = {'fields': db.source_fields(sid),
            'entities': db.source_entities(sid, 10)}
    return HttpResponse(simplejson.dumps(data),
                        mimetype='application/json')