Skip to content

Commit c98d7b0

Browse files
authored
Merge pull request #40 from zhangchunlin/master
Sync
2 parents 48d43d3 + d960506 commit c98d7b0

File tree

5 files changed

+398
-13
lines changed

5 files changed

+398
-13
lines changed

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

+7
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@
8383
]
8484

8585
comment_list = [
86+
{
87+
"username" : "admin",
88+
"to_username" : "userb",
89+
"moment_id" : 1,
90+
"date" : "2018-11-1",
91+
"content" : "comment from admin",
92+
},
8693
{
8794
"username" : "usera",
8895
"to_username" : "userb",

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

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ class Moment(Model):
1616
content = Field(TEXT)
1717
picture_list = Field(JSON, default=[])
1818

19+
@classmethod
20+
def owner_condition(cls,user_id):
21+
print("Moment: owner_condition")
22+
return cls.c.user_id==user_id
23+
1924
class Comment(Model):
2025
user_id = Reference("user")
2126
to_id = Reference("user")

0 commit comments

Comments
 (0)