biweeklybudget.flaskapp.views.fuel module¶
-
class
biweeklybudget.flaskapp.views.fuel.
FuelAjax
[source]¶ Bases:
biweeklybudget.flaskapp.views.searchableajaxview.SearchableAjaxView
Handle GET /ajax/fuelLog endpoint.
-
_filterhack
(qs, s, args)[source]¶ DataTables 1.10.12 has built-in support for filtering based on a value in a specific column; when this is done, the filter value is set in
columns[N][search][value]
where N is the column number. However, the python datatables package used here only supports the globalsearch[value]
input, not the per-column one.However, the DataTable search is implemented by passing a callable to
table.searchable()
which takes two arguments, the current Query that’s being built, and the user’ssearch[value]
input; this must then return a Query object with the search applied.In python datatables 0.4.9, this code path is triggered on
if callable(self.search_func) and search.get("value", None):
As such, we can “trick” the table to use per-column searching (currently only if global searching is not being used) by examining the per-column search values in the request, and setting the search function to one (this method) that uses those values instead of the global
search[value]
.Parameters: Returns: Query with searching applied
Return type: sqlalchemy.orm.query.Query
-
methods
= {'GET'}¶
-
-
class
biweeklybudget.flaskapp.views.fuel.
FuelLogFormHandler
[source]¶ Bases:
biweeklybudget.flaskapp.views.formhandlerview.FormHandlerView
Handle POST /forms/fuel
-
methods
= {'POST'}¶
-
-
class
biweeklybudget.flaskapp.views.fuel.
FuelMPGChartView
[source]¶ Bases:
flask.views.MethodView
Handle GET /ajax/chart-data/fuel-economy endpoint.
-
methods
= {'GET'}¶
-
-
class
biweeklybudget.flaskapp.views.fuel.
FuelPriceChartView
[source]¶ Bases:
flask.views.MethodView
Handle GET /ajax/chart-data/fuel-prices endpoint.
-
methods
= {'GET'}¶
-
-
class
biweeklybudget.flaskapp.views.fuel.
FuelView
[source]¶ Bases:
flask.views.MethodView
Render the GET /fuel view using the
fuel.html
template.-
methods
= {'GET'}¶
-
-
class
biweeklybudget.flaskapp.views.fuel.
VehicleAjax
[source]¶ Bases:
flask.views.MethodView
Handle GET /ajax/vehicle/<int:vehicle_id> endpoint.
-
methods
= {'GET'}¶
-
-
class
biweeklybudget.flaskapp.views.fuel.
VehicleFormHandler
[source]¶ Bases:
biweeklybudget.flaskapp.views.formhandlerview.FormHandlerView
Handle POST /forms/vehicle
-
methods
= {'POST'}¶
-