Questions tagged [flask-restless]

Flask-Restless provides simple generation of ReSTful APIs for database models defined using SQLAlchemy (or Flask-SQLAlchemy)

Flask-Restless provides simple generation of ReSTful APIs for database models defined using SQLAlchemy (or Flask-SQLAlchemy). The generated APIs send and receive messages in JSON format.

116 questions
2
votes
1 answer

Flask-Restless case-insensitive query

How to make case-insensitive search query using Flask-Restless? Example: api/user?q={"filters":[{"name":"lastname","op":"like","val":"%davidson%"}]} I would like the previous code to return "davidson", "Davidson", "DAVIDSON"... But it only returns…
clemtoy
  • 1,681
  • 2
  • 18
  • 30
2
votes
1 answer

Searching an exact match for the attribute of a relation

I have following SQLAlchemy DB models describing parts that go through several production steps: class Part(db.Model): part_number = db.Column(db.Integer, primary_key=True) production_steps = db.relationship("ProductionStep") class…
Phonolog
  • 6,321
  • 3
  • 36
  • 64
2
votes
0 answers

Flask-restless support mysql json column type

Does flask-restless support querying across json column types? If so, how are the queries formatted? I have a database with 3 columns that are of json type. Example json value in addresses column is: {'country': 'US'} How should the query be…
JMKrimm
  • 224
  • 1
  • 13
2
votes
1 answer

How to construct a "group_by" SQL query in flask-restless?

I am using flask_sqlalchemy and flask_restless to create an API endpoint to access data from a PostgreSQL database. How do I construct the following SQL query in flask-restless? SELECT AVG("SpeedBand"), "Location" FROM public.traffic_data WHERE…
2
votes
0 answers

Flask-Restless How can i get API from params not a JSON type and filter from those params?

How can i get API from params not a JSON type and filter from those params? Ex: http://localhost:5000/api/person/1?a=1&b=2&c=3
2
votes
1 answer

How to init restless as flask blueprint

I do not know how to do properly. blueprint api: # coding: utf-8 from flask import Blueprint, render_template from ..models import User from flask_restless import APIManager manager = APIManager() manager.create_api(User, url_prefix='/api',…
Narnik Gamarnik
  • 1,049
  • 1
  • 16
  • 35
2
votes
1 answer

Flask Restless CSRF exempt authentication URL

I am using Flask Restless 0.17 and Flask JWT for the API portion of an application. In the front-end of the application I am using Flask WTF and its CSRF protection. This is creating issues with Flask Restless as WTF expects a CSRF token on every…
duffn
  • 3,690
  • 8
  • 33
  • 68
2
votes
1 answer

How to PATCH in flask-restless?

What is the right way to perform a PATCH request in flask-restless? I am getting the following response error: {u'errors': [{u'status': 400, u'code': None, u'links': None, u'title': None, u'detail': u'Must specify correct data type', u'source':…
user706838
  • 5,132
  • 14
  • 54
  • 78
2
votes
0 answers

Python flask restless search query to find date regardless of time

I'm using Flask and Flask-Restless and have a model that looks like this: class Task(db.Model): __tablename__ = 'Task' id = db.Column(db.Integer, primary_key=True) stable_id = db.Column(db.Integer, ForeignKey('Stable.id')) taskDate =…
stinaq
  • 1,274
  • 3
  • 19
  • 31
2
votes
1 answer

flask-restless restrict RESTfull api access

I only want logged-in users to access my RESTfull API. I have been searching all over and couldn't find any source which tells me how to do it. Weird, because I think it's very common to protect data. I am using a Flask project with Flask-login and…
Waxyen Flax
  • 101
  • 3
  • 9
2
votes
1 answer

Complex routes for Flask-Restless (e.g. "forgot password")

I wish to make a route for "forgot password"-functionality, while using Flask-Restless. My idea was that the request could look like this: POST /api/user//forgot_password and Flask-Restless would send this request to a custom "forgot…
haeger
  • 623
  • 5
  • 14
2
votes
1 answer

How to search a model by date with Flask-Restless

According to the documentation, a search query should look like: GET /api/person?q={"filters":[{"name":"age","op":"ge","val":10}]} How do I compare a date? I tried: GET /api/person?q={"filters":[{"name":"date","op":"<=","val":"1/20/2015"}]} That…
DFenstermacher
  • 564
  • 1
  • 9
  • 23
2
votes
0 answers

Flask Restless: increment column on many to many table

I am currently working with Flask, Flask-SQLAchlemy and Flask-Restless to provide endpoints for an AngularJS backend application. I have set up the necessary many to many relationships between tables thanks to another user. I have a new issue,…
DFenstermacher
  • 564
  • 1
  • 9
  • 23
2
votes
1 answer

Accessing request headers in flask-restless preprocessor

I'm building an API with Flask-Restless that requires an API key, that will be in the Authorization HTTP header. In the Flask-Restless example here for a preprocessor: def check_auth(instance_id=None, **kw): # Here, get the current user from the…
Casey
  • 12,070
  • 18
  • 71
  • 107
1
vote
1 answer

Which Flask extension should I choose to work with API's?

I've tried to work with Flask-Restless, but I'm not sure, I think its unable to work with factory pattern and blueprints. I want to find something similar to Restless(simple generation/JSON format) but compatible with the factory pattern &…
Manuel Semeco
  • 53
  • 2
  • 6