biweeklybudget.flaskapp.views.payperiods module

class biweeklybudget.flaskapp.views.payperiods.PayPeriodView[source]

Bases: flask.views.MethodView

Render the single PayPeriod GET /payperiod/YYYY-MM-DD view using the payperiod.html template.

get(period_date)[source]
methods = {'GET'}
suffix_for_period(curr_pp, pp)[source]

Generate the suffix to use for the given pay period in the view

Parameters:
Returns:

suffix for the pay period

Return type:

str

class biweeklybudget.flaskapp.views.payperiods.PayPeriodsView[source]

Bases: flask.views.MethodView

Render the top-level GET /payperiods view using payperiods.html template

get()[source]
methods = {'GET'}
class biweeklybudget.flaskapp.views.payperiods.PeriodForDateView[source]

Bases: flask.views.MethodView

Render a redirect from a given date to the pay period for that date

get()[source]
methods = {'GET'}
class biweeklybudget.flaskapp.views.payperiods.SchedToTransFormHandler[source]

Bases: biweeklybudget.flaskapp.views.formhandlerview.FormHandlerView

Handle POST /forms/sched_to_trans

methods = {'POST'}
submit(data)[source]

Handle form submission; create or update models in the DB. Raises an Exception for any errors.

Parameters:data (dict) – submitted form data
Returns:message describing changes to DB (i.e. link to created record)
Return type:str
validate(data)[source]

Validate the form data. Return None if it is valid, or else a hash of field names to list of error strings for each field.

Parameters:data (dict) – submitted form data
Returns:None if no errors, or hash of field name to errors for that field
class biweeklybudget.flaskapp.views.payperiods.SkipSchedTransFormHandler[source]

Bases: biweeklybudget.flaskapp.views.formhandlerview.FormHandlerView

Handle POST /forms/skip_sched_trans

methods = {'POST'}
submit(data)[source]

Handle form submission; create or update models in the DB. Raises an Exception for any errors.

Parameters:data (dict) – submitted form data
Returns:message describing changes to DB (i.e. link to created record)
Return type:str
validate(data)[source]

Validate the form data. Return None if it is valid, or else a hash of field names to list of error strings for each field.

Parameters:data (dict) – submitted form data
Returns:None if no errors, or hash of field name to errors for that field