We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 48d43d3 + d960506 commit c98d7b0Copy full SHA for c98d7b0
tests/demo/apps/apijson_demo/dbinit.py
@@ -83,6 +83,13 @@
83
]
84
85
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
+ },
93
{
94
"username" : "usera",
95
"to_username" : "userb",
tests/demo/apps/apijson_demo/models.py
@@ -16,6 +16,11 @@ class Moment(Model):
16
content = Field(TEXT)
17
picture_list = Field(JSON, default=[])
18
19
+ @classmethod
20
+ def owner_condition(cls,user_id):
21
+ print("Moment: owner_condition")
22
+ return cls.c.user_id==user_id
23
+
24
class Comment(Model):
25
user_id = Reference("user")
26
to_id = Reference("user")
0 commit comments