Skip to content

Commit 20a9c31

Browse files
authored
Merge pull request #42 from zhangchunlin/master
Sync
2 parents 6962b31 + 1b303bf commit 20a9c31

File tree

6 files changed

+434
-17
lines changed

6 files changed

+434
-17
lines changed

Diff for: CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
- 0.2.1(2019-10-22)
4+
- **apison-post: modify to be same with original apijson, just return "id" and "count", not other fields**
5+
- apijson-table: fix key and title problem in viewedit_items
6+
- apijson-viewedit: fix @role
7+
- apijson-table: fix apijson-put and apijson-delete @role not work problem
8+
- doc: add difference in tag parameter in apijson post/put
9+
- **tests: add 97 test cases, and fix bugs found by tests**
10+
- fix "NameError: name 'log' is not defined"
11+
- fix py2/3 compatible
12+
- fix issue #4 :"NameError: name 'UliwebError' is not defined"
13+
- apijson-table: add hook_add, for customizing the add action in apijson-table component
314
- 0.2.0(2019-09-17)
415
- setup: add fix utf8 for reading file
516
- **fix json response structure to be same as original apijson api (java)**

Diff for: tests/demo/apps/apijson_demo/models.py

+4
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ class Comment(Model):
3131
class PublicNotice(Model):
3232
date = Field(datetime.datetime, auto_now_add=True)
3333
content = Field(TEXT)
34+
35+
class NoRequestTag(Model):
36+
user_id = Reference("user")
37+
content = Field(TEXT)

Diff for: tests/demo/apps/apijson_demo/settings.ini

+10-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ privacy = 'apijson_demo.models.Privacy'
33
comment = 'apijson_demo.models.Comment'
44
moment = 'apijson_demo.models.Moment'
55
publicnotice = 'apijson_demo.models.PublicNotice'
6+
norequesttag = 'apijson_demo.models.NoRequestTag'
67

78
[APIJSON_MODELS]
89
user = {
@@ -42,8 +43,8 @@ publicnotice = {
4243
"GET" : { "roles" : ["OWNER","LOGIN","ADMIN","UNKNOWN"] },
4344
"HEAD" : { "roles" : ["OWNER","LOGIN","ADMIN","UNKNOWN"] },
4445
"POST" : { "roles" : ["OWNER","ADMIN"] },
45-
"PUT" : { "roles" : ["OWNER","ADMIN"] },
46-
"DELETE" : { "roles" : ["OWNER","ADMIN"] },
46+
"PUT" : { "roles" : ["OWNER","ADMIN","UNKNOWN"] },
47+
"DELETE" : { "roles" : ["OWNER","ADMIN","UNKNOWN"] },
4748
}
4849

4950
[APIJSON_REQUESTS]
@@ -68,5 +69,12 @@ comment = {
6869
"PUT" :{
6970
"ADD":{"@role": "OWNER"},
7071
"NECESSARY" : ["id","content"],
72+
"DISALLOW" : ["user_id","to_id"],
7173
},
7274
}
75+
76+
publicnotice = {
77+
"PUT" :{
78+
"NECESSARY" : ["id","content"],
79+
}
80+
}

0 commit comments

Comments
 (0)