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

flask-RESTful vs flask-RESTless, which should be used, and when

What are the key differences of these two libraries.In terms of usability, and features If you already have a huge number of model classes, using flask-restLESS makes perfect sense, right?. What are the features it would lack, if it would done with…
ISONecroMAn
  • 1,460
  • 2
  • 16
  • 23
16
votes
2 answers

How do I seed a flask sql-alchemy database

I am new at python, I just learnt how to create an api using flask restless and flask sql-alchemy. I however would like to seed the database with random values. How do I achieve this? Please help. Here is the api code... import flask import…
Ingadi
  • 563
  • 1
  • 7
  • 20
13
votes
3 answers

Flask app dont start on heroku server

I'm trying to deploy a Flask app with Heroku. It's simple API. Works great local with foreman but I get error (log is below) when starts on heroku. This is my app code (I know it's but looking in one block, but I have problems to split it to…
Mr Jedi
  • 33,658
  • 8
  • 30
  • 40
10
votes
2 answers

Combining Flask-restless, Flask-security and regular Python requests

My goal is to provide a REST API to my web application. Using: Python 2.7.5 Flask==0.10.1 Flask-Restless==0.13.1 Flask-Security==1.7.3 I need to secure access to my data for both web and REST access. However, I am unable to get any regular python…
Nic
  • 3,365
  • 3
  • 20
  • 31
8
votes
2 answers

Modify JSON response of Flask-Restless

I am trying to use Flask-Restless with Ember.js which isn't going so great. It's the GET responses that are tripping me up. For instance, when I do a GET request on /api/people for example Ember.js expects: { people: [ { id: 1, name:…
Drew Larson
  • 710
  • 7
  • 12
7
votes
1 answer

many to many relationship using flask restless, post a one to many data

My question is about how to use post to add more than one many to many relationship datas I'm using flask, flask-SQLAlchemy, flask-restless and angularjs, json I have some tables like this class Page(db.Model): id = db.Column(db.Integer,…
6
votes
2 answers

How to return "already exists" error in Flask-restless?

I would like to do some handler for exception. I'm using a combination of Flask-restless and SQLAlchemy in python. My problem: When I send request to api with object that already exists in DB, SQLAlchemy shows exception: IntegrityError:…
Meph-
  • 657
  • 1
  • 8
  • 20
5
votes
1 answer

Error when performing a join in SQLAlchemy 'Please specify the 'onclause' of this join explicitly.'

I have the following sqlalchemy model using flask-sqlalchemy. I have 3 talentpref items in my schedule model. There will always need to be 3 and no fewer. class TalentPref(db.Model): __tablename__ = 'talentpref' id = db.Column(db.Integer,…
blackirishman
  • 903
  • 1
  • 10
  • 23
5
votes
0 answers

Flask Restless JSON formatting decimal

I'm using Flask-Restless 0.17 for an API. The API has several fields that are decimals. I can successfully return decimals by installing simplejson as talked about here: https://stackoverflow.com/a/15224186/1753891. However, when I have a decimal…
duffn
  • 3,690
  • 8
  • 33
  • 68
4
votes
1 answer

How to correctly redirect/submit POST request from a form (wtforms) to a REST api (flask-restless)?

I can't find a proper way to redirect data from submitted form to a REST api. Currently - like in example below - "POST" method is handled in the view/route (see route "add_person()"). My sample data model (SQLAlchemy-based): class…
schedar
  • 419
  • 6
  • 21
4
votes
1 answer

Flask restless - A search filter for a relationship.property != val in case of one-to-many relationship

Flask-sqlalchemy Models for my book and actions tables are class Book(db.Model): __tablename__ = 'book' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(255)) activity = db.relationship('Actions') class…
Hussain
  • 5,057
  • 6
  • 45
  • 71
4
votes
1 answer

Flask-Restless order_by related model

I have these two models (defined using Flask-SQLAlchemy): class BankAccount(db.Model): id = db.Column(db.Integer, primary_key=True) customer_id = db.Column(db.Integer, db.ForeignKey('customer.id')) created_at =…
4
votes
2 answers

Flask-SQLAlchemy and Flask-Restless not fetching grandchildren

Problem I am building an app on Flask, Flask-SQLAlchemy, and Flask-Restless. I have used restless to generate an API for a parent-child-grandchild relationship*. A GET on my child will correctly fetch the grandchild, but a GET on the parent will not…
3
votes
1 answer

python flask_restless with sqlalchemy doesn't generate api endpoints and gives "has no attribute extensions" error using blueprints

for my webapp I want to automatically generate a REST API. I read the of flask_restless docs, tried several tutorials and did everything as described: my routes are to be located in module app.main.api.pv_tool.py from . import api from app.__init__…
Rich Steinmetz
  • 1,020
  • 13
  • 28
3
votes
1 answer

Modifying a Flask-Restless result array

I have something like this: { "id": 1, "username": "plasmy", "userdetails": [ { "detail": "A Name", "detail_name": "Full Name", "id": 1, "user_id": 1 }, { "detail": "an@email.com", …
plasmy
  • 99
  • 3
  • 9
  • 32
1
2 3 4 5 6 7 8