![]() ![]() The post's foreign key simply points to the Post model you just created. AUTH_USER_MODEL for the table in the foreign key for reported_by. Like the post model, you will use the settings. You only need two fields here: post and reported_by, where post refers to the post that got reported and reported_by is the user who created the report. The other model you need is for making reports. You need to import settings from nf at the top of the file. AUTH_USER_MODEL to reference the user model instead of importing the model directly. The only difference is for creating foreign keys to the user model, you need to use the settings. CASCADE, blank = True, null = True, related_name = 'mod_who_hid' ) def _str_ (self ) : return self. DateTimeField (blank = True, null = True ) BooleanField (default = False )ĭate_hidden = models. CharField (max_length = 280 )ĭate_posted = models. You can go ahead and create that model now in models. Instead, they will only be allowed to hide users, so hidden posts can be tracked and potentially unhidden. Regarding the last three, moderators won't be allowed to delete any data.
0 Comments
Leave a Reply. |