Open pekof opened 6 years ago
Which version are you using?
Can you try the current master branch?
flask-restless==1.0.0b1
flask==0.12.2 flask-babel==0.11.2 Flask-Bootstrap==3.3.7.1 flask-sqlalchemy==2.3.2
I will see if I could run master
It's working with current master branch
You can define a new id field just in the model and map it the relevant primary key column.
I'm working with legacy database table where primary key is not named
id
butJobID
orID,
so when I trymanager.create_api(PhClientOut, primary_key='JobID', methods=['GET'])
I get error
File "D:/0work/Transfer/central/central.py", line 125, in <module> manager.create_api(ClientOut, methods=['GET'], primary_key='JobID') File "C:\Users\frane\AppData\Local\Continuum\Anaconda3\lib\site-packages\flask_restless\manager.py", line 830, in create_api blueprint = self.create_api_blueprint(blueprint_name, *args, **kw) File "C:\Users\frane\AppData\Local\Continuum\Anaconda3\lib\site-packages\flask_restless\manager.py", line 604, in create_api_blueprint raise IllegalArgumentError(msg) flask_restless.manager.IllegalArgumentError: Provided model must have an
idattribute
There should be way to define alternative
id
attribute name.