python - Should I delete or set a variable to "deleted" in django/postgresql? -
specifically app, have created model in order allow user (the user_parent) follow other users.
class follow(models.model): user_parent = models.foreignkey(user, unique=true, related_name="follow_set") users_followed = models.manytomanyfield(user, related_name="follow_followed")
whenever user parent follows user, user being followed added variable users_followed.
right trying figure out how best unfollow other users. delete user being followed users_followed variable or should add field model describing whether user still being followed or not?
which expensive action database perform?
it same in terms of expense, since table update. either approach should fine
Comments
Post a Comment