pytwask.tweets package

Submodules

pytwask.tweets.forms module

This module defines all the tweet-related forms.

Courtesy of http://flask.pocoo.org/snippets/64/

class pytwask.tweets.forms.FollowForm(formdata=<object object>, **kwargs)

Bases: flask_wtf.form.FlaskForm

The form for following a user.

submit = <UnboundField(SubmitField, ('Follow',), {})>
class pytwask.tweets.forms.PostTweetForm(formdata=<object object>, **kwargs)

Bases: flask_wtf.form.FlaskForm

The form for posting a tweet.

submit = <UnboundField(SubmitField, ('Post',), {})>
tweet = <UnboundField(TextAreaField, ('',), {'render_kw': {'rows': 10, 'cols': 30}, 'validators': [<wtforms.validators.DataRequired object>]})>
class pytwask.tweets.forms.UnfollowForm(formdata=<object object>, **kwargs)

Bases: flask_wtf.form.FlaskForm

The form for unfollowing a user.

submit = <UnboundField(SubmitField, ('Unfollow',), {})>

pytwask.tweets.views module

This module defines all the tweet-related views.

pytwask.tweets.views.follow(username)

This view handles the follow form in the user history page.

pytwask.tweets.views.general_timeline()

This view renders the general timeline.

pytwask.tweets.views.inject_general_timeline()

This function injects the function object ‘Tweet.get_general_timeline’ into the application context so that ‘get_general_timeline’ can be accessed in Jinja2 templates.

pytwask.tweets.views.unfollow(username)

This view handles the unfollow form in the user history page.

pytwask.tweets.views.user_history(username)

This view renders the user history. It will

  • display all the tweets posted by this user;
  • allow the logged-in user to follow/unfollow this user if they are different.
pytwask.tweets.views.user_timeline(username=None)

This view renders the user timeline. It also allows the user to post tweets.

Module contents

The blueprint which contains all the tweet-related views.