Handling 404
Aug 16 2016- POSTED BY projecth
We can control 404 errors and bad requests using the abort() function provided by flask. What it does is that […]
Read More
Comments Off on Handling 404
We can control 404 errors and bad requests using the abort() function provided by flask. What it does is that […]
Read More[models.py] class User(UserMixin, Model): …. def get_stream(self): return Post.select().where( (Post.user << self.following()) | (Post.user == self) ) def following(self): …. […]
Read More[user_stream.html] … <div class=”grid-25″> <h5>Followers</h5> <p>{{ user.followers().count() }}</p> </div> <div class=”grid-25″> <h5>Following</h5> <p>{{ user.following().count() }}</p> </div> … <div class=”grid-25″> {% […]
Read MoreRelationship Model [models.py] … class User(UserMixin, Model): … def following(self): “””Users that current user follows.””” return User.select().join( Relationship, on=Relationship.to_user ).where( […]
Read More