Comments (1)
I've never used viewonly
myself, thanks for bringing this up. I've just tried to reproduce your problems with this (your example is incomplete, so I had to do some guesswork, e.g. you never use CommonColumns
and get_current_user_id
is not defined).
I've come up with https://github.com/pyeve/eve-sqlalchemy/tree/viewonly/eve_sqlalchemy/examples/viewonly and tried to POST to /nodes
, which works fine and GET-ing gives created_by
and organization
(see below). Can you maybe amend this example to show your problems with viewonly
?
$ curl -i -X POST -H "Content-Type: application/json" -d '{}' localhost:5000/nodes
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 227
Location: http://localhost:5000/nodes/1
Server: Eve/0.7.10 Werkzeug/0.11.15 Python/3.6.6
Date: Mon, 12 Nov 2018 07:54:55 GMT
{"_updated": "Mon, 12 Nov 2018 07:54:55 GMT", "_created": "Mon, 12 Nov 2018 07:54:55 GMT", "_etag": "d4c403081de4d25f9005fa33ef10fcaa4f2b0063", "id": 1, "_links": {"self": {"title": "Node", "href": "nodes/1"}}, "_status": "OK"}
$ curl -i -X POST -H "Content-Type: application/json" -d '{}' localhost:5000/nodes
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 227
Location: http://localhost:5000/nodes/2
Server: Eve/0.7.10 Werkzeug/0.11.15 Python/3.6.6
Date: Mon, 12 Nov 2018 07:54:57 GMT
{"_updated": "Mon, 12 Nov 2018 07:54:57 GMT", "_created": "Mon, 12 Nov 2018 07:54:57 GMT", "_etag": "9901a9d0f565369c2e49774aa3b3e3b4764f5aaf", "id": 2, "_links": {"self": {"title": "Node", "href": "nodes/2"}}, "_status": "OK"}
$ curl localhost:5000/nodes | python -m json.tool
{
"_items": [
{
"created_by": 1,
"updated_by": 1,
"organization": [
1
],
"id": 1,
"_updated": "Mon, 12 Nov 2018 07:54:55 GMT",
"_created": "Mon, 12 Nov 2018 07:54:55 GMT",
"_etag": "d4c403081de4d25f9005fa33ef10fcaa4f2b0063",
"_links": {
"self": {
"title": "Node",
"href": "nodes/1"
}
}
},
{
"created_by": 1,
"updated_by": 1,
"organization": [
1
],
"id": 2,
"_updated": "Mon, 12 Nov 2018 07:54:57 GMT",
"_created": "Mon, 12 Nov 2018 07:54:57 GMT",
"_etag": "9901a9d0f565369c2e49774aa3b3e3b4764f5aaf",
"_links": {
"self": {
"title": "Node",
"href": "nodes/2"
}
}
}
],
"_links": {
"parent": {
"title": "home",
"href": "/"
},
"self": {
"title": "nodes",
"href": "nodes"
}
},
"_meta": {
"page": 1,
"max_results": 25,
"total": 2
}
}
from eve-sqlalchemy.
Related Issues (20)
- Column of type UUID fails to insert default HOT 1
- 502 for PATCH HOT 1
- Cannot replace BaseQuery with a Custom query_class (soft delete custom query class) HOT 1
- How to add validations with Eve-sqlalchemy HOT 1
- Is OPLOG supported? HOT 5
- any plan to keep updated with eve ? HOT 1
- Updating datasource leads to KeyError HOT 2
- Missing documentation on how to install
- TypeError: find() got an unexpected keyword argument 'perform_count' HOT 1
- eve.exceptions.ConfigException: User.id is not unique HOT 1
- Please specify `related_resources` manually HOT 2
- TypeError: '_updated' is an invalid keyword argument for Network HOT 2
- Is it possible to change compatible version of Eve from "<0.8" to the latest Eve? HOT 1
- Many-to-many issue HOT 1
- UserWarning: No validation schema is defined for the arguments of rule 'data_relation' / 'dependencies' / 'unique' HOT 1
- when will be eve_sqlalchemy update? HOT 2
- Support for SQLAlchemy 1.4
- Upgrade to eve-sqlalchemy 0.7.1 / hybrid_property / AttributeError: Neither 'InstrumentedAttribute' object nor 'Comparator' object associated with <relation> has an attribute <column>
- ImportError: cannot import name 'Iterable' from 'collections'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eve-sqlalchemy.