Ejemplo n.º 1
0
def read_db():
    # Getting requried objects from request
    collection = request.get_json()["collection"]
    jsonobj = request.get_json()["jsonobj"]
    fields = request.get_json()["fields"]

    return dbapi.query(collection, jsonobj, fields), 200, {"Content-type":"application/json"}
Ejemplo n.º 2
0
 def get_zpoints(self):
     points = query(GlyphOutline, GlyphParam)
     points = points.filter(GlyphOutline.glyph_id == self.id)
     points = points.filter(GlyphParam.glyphoutline_id == GlyphOutline.id)
     zpoints = []
     for outline, param in points.order_by(GlyphOutline.pointnr.asc()):
         if re.match('z\d+[rl]', param.pointname):
             zpoints.append(param)
     return zpoints
Ejemplo n.º 3
0
 def get(cls, **kwargs):
     try:
         return query(cls).filter_by(**kwargs).one()
     except NoResultFound:
         return None