Beispiel #1
0
 def one(self, value, field=None):
     if not field:
         field = self.model.identify_primary_key()
     self.filters.update({field: value})
     query = self.create_query(self.columns(self.queryargs.exclusions))
     buffer = QueryBuffer(query, self.model, vflag=False, queryargs=self.queryargs)
     return buffer.filter_by(self.filters).first()
Beispiel #2
0
 def query(self, noauto=False):
     query = self.create_query()
     buffer = QueryBuffer(query, self.model, queryargs=self.queryargs)
     if noauto:
         return buffer
     buffer.autoquery()
     return buffer
Beispiel #3
0
 def _get(self, flagged=False):
     query = self.create_query(self.columns(self.queryargs.exclusions))
     self._schema = query.column_descriptions
     # includes
     # excludes
     # relationships
     buffer = QueryBuffer(query, self.model, queryargs=self.queryargs)
     return buffer.all()
Beispiel #4
0
 def iquery(self):
     query = self.create_query()
     self._schema = query.column_descriptions
     return QueryBuffer(query, self.model).query
Beispiel #5
0
 def get_one_by(self, field, value, flagged=False):
     pkfilter = {field: value}
     query = self.create_query(self.columns(self.queryargs.exclusions))
     self._schema = query.column_descriptions
     buffer = QueryBuffer(query, self.model, vflag=flagged, queryargs=self.queryargs)
     return buffer.filter_by(pkfilter).first()
Beispiel #6
0
 def get_one(self, value, flagged=False):
     self.filters.update({self.model.id: value})
     query = self.create_query(self.columns(self.queryargs.exclusions))
     self._schema = query.column_descriptions
     buffer = QueryBuffer(query, self.model, vflag=flagged, queryargs=self.queryargs)
     return buffer.filter_by(self.filters).first()