Conversation
Adds an `odometer_unit` field to the Vehicle model, allowing users to configure miles or km independently per vehicle. This is useful when managing vehicles with different odometer units (e.g. a UK car in miles and a foreign import or motorbike in km). - Add `odometer_unit` column to vehicles table (nullable, defaults to user pref) - Add `ODOMETER_UNITS` constant list and `get_effective_odometer_unit()` helper - Add odometer unit selector to vehicle create/edit form - Update fuel log list, fuel forms, and vehicle view to display the vehicle's effective unit rather than the global user preference - Update Tessie odometer/range display to respect per-vehicle unit - Create Alembic migration for the new column
Convert FuelPriceHistory ORM objects to serializable dicts before passing to the template's tojson filter for Chart.js rendering.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Bug Fix — Price History 500 Error (Issue #78)
FuelPriceHistoryORM objects were passed to Jinja2'stojsonfilterprices_json) for Chart.js while keeping ORM objects for HTML table renderingNew Feature — Per-Vehicle Odometer Units (Issue #79)
odometer_unitcolumn to Vehicle model (km, mi, or None to inherit user default)get_effective_odometer_unit()method with fallback to user's global preferenceTest plan