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
0
votes
1 answer

Getting stuck with database connections in Flask-Restless

I'm trying to use Flask to serve up data on PythonAnywhere and looking to use the Flask-Restful, but realise I'm getting a little confused. @app.route("/test") def create_api(): engine = create_engine(SQLALCHEMY_DATABASE_URI) Session =…
elksie5000
  • 7,084
  • 12
  • 57
  • 87
0
votes
1 answer

POST request error, Flask-Restless issue

I'm facing a very weird problem with a post request. I'm using Flask-Restless to create an API with GET and POST methods. In my view a have a button and `onclick i would like to send a POST request. My code: var Insert = function(inputdata) { …
Panos Angelopoulos
  • 525
  • 1
  • 6
  • 14
0
votes
0 answers

How to use Flask-Restless with a geographical database and connect it to an interface?

I have thoroughly searched and I already know what to do (it is in the title). But the question here is: How do I start? Are there any examples of this? I need to have a geographical database that is connected to a Flask-Restless API. How do I…
Shoplifter20
  • 151
  • 2
  • 2
  • 12
0
votes
1 answer

Creating API for SQLAlchemy Table using Flask-Restless

I use Python, Flask, Flask-SQLAlchemy and Flask-Restless to create a RESTful API. The database contains a table user. Each user can follow other users and each user can be followed by other users (like in Twitter). So I also have a table followers…
clemtoy
  • 1,681
  • 2
  • 18
  • 30
0
votes
1 answer

POST request to read data from Flask-restless

I'm trying to implement server side filtering using KendoUI grid and Flask-Restless web service. My Datasource object looks like this: var myDataSource = new kendo.data.DataSource({ transport: { read: { …
Matej
  • 932
  • 4
  • 14
  • 22
0
votes
1 answer

Restless - "objects" wrapper

I'm working with Restless and as stated in the documentation, returning Model.objects.all() produces something like this: { "objects": [ { "id": 1, "title": "First Post!", "author": "daniel", …
gkpo
  • 2,623
  • 2
  • 28
  • 47
0
votes
1 answer

Flask-Restless: manager.create_api() does not return blueprint object

I am using Flask-Restless extension for my simple REST service. And now I want to enable CORS. According this article http://flask-restless.readthedocs.org/en/latest/customizing.html I tried to use the following code to enable CORS: import…
Sergey
  • 5,396
  • 3
  • 26
  • 38
0
votes
2 answers

Creating API responses with flask-restless

Let's say I have two models in SqlAlchemy: UserType User User has a foreign key to UserType I have properly configured flask-restless to serve these models as API endpoints: /api/user /api/user_type But by default, when I visit either of these…
kbuilds
  • 991
  • 11
  • 19
0
votes
2 answers

Serializing Python Arrow objects for the Flask-Restless API

I am currently developing an application with Flask-Restless. When I substituted my SQLAlchemy models' typical DateTime fields with corresponding arrow fields, all went smoothly. This was due to the help of SQLAlchemy-Utils and its ArrowType…
Greg Ziegan
  • 5
  • 2
  • 2
0
votes
1 answer

Python Flask SQLalchemy JSON POST Error

I'm trying to post the following JSON and save to a MySQL database on a Flask server and Python 2.7, restless framework and SQLAlchemy with curl: curl -i -H "Accept: application/json" -X POST -d '{"attribute_id": "1", "product_id":…
Seroney
  • 805
  • 8
  • 26
0
votes
0 answers

Flask-restless - How to convert a DELETE request into an UPDATE

What is the proper way to convert a DELETE request into an UPDATE? I am doing something like that: api_manager.create_api(News, methods=['GET', 'POST', 'DELETE', 'PUT'], preprocessors={'DELETE':…
Cabu
  • 514
  • 2
  • 5
  • 15
0
votes
1 answer

Disabling Angular $http.get URL encoding for query parameters

I am using Flask-Restless to create my API, which requires queries parameters to be formatted using a list of filter objects. A valid query follows this format: /api/person?q={"filters":[{"name":"firstName","op":"like","val":"Mike"}]} (See…
Josh
  • 662
  • 11
  • 27
0
votes
2 answers

Flask restless operators not filtering properly

I'm developing a login for a mobile web app using Flask and Flask restless. For the moment I have only 1 record in my database for testing, when I send my AJAX request to Flask restless, it seems to return me this record all the time. Here's an…
user1659653
  • 334
  • 2
  • 5
  • 15
0
votes
0 answers

Flask-Restful interupt PUT based on logic

I am trying to use a preprocessor in Flask-Restless to check for a condition and if the condition is met to interrupt the PUT statement and not update the database. I've tried to del or empty the data dict but that does not seem to be working: def…
RedRaven
  • 725
  • 2
  • 18
  • 33
0
votes
3 answers

nosetests/unittest still shows error when test passes?

I have a unit test that tests if an api point is unaccessible if not authenticated like this: def test_endpoint_get_unauth(self): r = self.get('/api/endpoint/1') self.assertStatusCode(r, 401) The test passes, but nosetests/unittest still…
Patrick Yan
  • 2,338
  • 5
  • 25
  • 33