Comments (4)
initial implementation in 4.1.4
from guillotina.
Hi @vangheem, thank you for that.
I have a question though:
I have a folder with IAttachment behavior:
{"@id": "http://127.0.0.1:8080/db/c1/folder5", "@type": "Folder", "@name": "folder5", "@uid": "fe3|e589a5c8ff984ca8899deb8dd79a443d", "parent": {"@id": "http://127.0.0.1:8080/db/c1", "@name": "c1", "@type": "Container", "@uid": "fe3b0df173a14b4691fd93e692202c4a", "UID": "fe3b0df173a14b4691fd93e692202c4a"}, "is_folderish": true, "creation_date": "2018-08-30T19:37:53.071538+00:00", "modification_date": "2018-08-30T20:16:31.207804+00:00", "UID": "fe3|e589a5c8ff984ca8899deb8dd79a443d", "type_name": "Folder", "title": "Folder tt", "uuid": "fe3|e589a5c8ff984ca8899deb8dd79a443d", "__behaviors__": ["guillotina.behaviors.attachment.IAttachment"], "__name__": "folder5", "guillotina.behaviors.dublincore.IDublinCore": {"title": "Folder tt", "description": null, "creation_date": "2018-08-30T19:37:53.071538+00:00", "modification_date": "2018-08-30T20:16:31.207804+00:00", "effective_date": null, "expiration_date": null, "creators": [], "tags": null, "publisher": null, "contributors": ["root"]}, "guillotina.behaviors.attachment.IAttachment": {"file": null}, "items": [], "length": 0}
then I do a PUT where I remove the guillotina.behaviors.attachment.IAttachment
attribute and I update the __behaviors__
value accordingly:
curl 'http://127.0.0.1:8080/db/c1/folder5' -X PUT -H 'Accept: application/json' -H 'Referer: http://localhost:4200/db/c1/folder5/@@edit' -H 'Origin: http://localhost:4200' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36' -H 'Authorization: Basic cm9vdDpyb290' -H 'Content-Type: application/json' --data-binary '{"@id":"http://127.0.0.1:8080/db/c1/folder5","@type":"Folder","@name":"folder5","@uid":"fe3|e589a5c8ff984ca8899deb8dd79a443d","parent":{"@id":"http://127.0.0.1:8080/db/c1","@name":"c1","@type":"Container","@uid":"fe3b0df173a14b4691fd93e692202c4a","UID":"fe3b0df173a14b4691fd93e692202c4a"},"is_folderish":true,"creation_date":"2018-08-30T19:37:53.071538+00:00","modification_date":"2018-08-30T20:16:31.207804+00:00","UID":"fe3|e589a5c8ff984ca8899deb8dd79a443d","type_name":"Folder","title":"Folder tt","uuid":"fe3|e589a5c8ff984ca8899deb8dd79a443d","__behaviors__":[],"__name__":"folder5","guillotina.behaviors.dublincore.IDublinCore":{"title":"Folder tt","description":null,"creation_date":"2018-08-30T19:37:53.071538+00:00","modification_date":"2018-08-30T20:16:31.207804+00:00","effective_date":null,"expiration_date":null,"creators":[],"tags":null,"publisher":null,"contributors":["root"]},"items":[],"length":0}' --compressed
I get a proper 204 response, but the behavior is still there.
Is it expected?
If I update a value like the IDublinCore title, the change is properly saved, so I guess it is more a problem about updating behaviors manually.
It would be nice if it was possible, but if removing behaviors with a direct PUT on the resource is too difficult technically, maybe we should get an error status when trying to, instead of a 204.
from guillotina.
Thanks Eric. I'll look into it--it's not too technically difficult. I'm just missing this part. Thanks for testing!
from guillotina.
Fixed by #335
from guillotina.
Related Issues (20)
- PG Table/ Container HOT 1
- CORS Middleware for asgi
- Field related items / reusable behaviors with ARC
- Transaction improvement HOT 4
- Proposal: generate default config with cors.allow_origin = "*" HOT 5
- DBUsers Patch Group deletes group from user
- Upgrade PyJWT >= 2.0.0
- python3.9 g command fails to shutdown HOT 2
- Status codes when authorised but without permission should be 403 HOT 5
- Add regex field in guillotina schema HOT 1
- Subscriber to prevent overriding values with outdated content HOT 2
- Remove DublinCore and switch to contextbehavior
- Searching by "SearchableText" is broken HOT 7
- Pass variable arguments to SMTPMailEndpoint (smtp) HOT 1
- GET /groups/ lacks group title
- Review current conflicts resolution logic
- Websocket connection failed HOT 4
- Issuing subrequests
- Change aioredis with redis-py
- ImportError: cannot import name 'implements' from 'zope.interface'
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 guillotina.