Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc98d7b0

Browse files
authored
Merge pull request#40 from zhangchunlin/master
Sync
2 parents48d43d3 +d960506 commitc98d7b0

File tree

5 files changed

+398
-13
lines changed

5 files changed

+398
-13
lines changed

‎tests/demo/apps/apijson_demo/dbinit.py

Lines changed: 7 additions & 0 deletions
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",

‎tests/demo/apps/apijson_demo/models.py

Lines changed: 5 additions & 0 deletions
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+
defowner_condition(cls,user_id):
21+
print("Moment: owner_condition")
22+
returncls.c.user_id==user_id
23+
1924
classComment(Model):
2025
user_id=Reference("user")
2126
to_id=Reference("user")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp