Core Models

class fyt.db.models.TripsYear(*args, **kwargs)[source]

Global config object. Each year of trips has one such object.

All other db objects point to their years’ TripsYear.

TODO: validate that there is only one object with is_current=True

Parameters:
  • year (PositiveIntegerField) – Year
  • is_current (BooleanField) – Is current
class fyt.db.models.DatabaseModel(*args, **kwargs)[source]

Abstract base class which manages the trips_year property for all models in the trips database.

TODO: rename this to TripsModel?

Parameters:trips_year_id (ForeignKey) – Trips year
classmethod get_app_name()[source]

Return the app name of cls.

classmethod get_model_name()[source]

Return the name of the model.

classmethod get_model_name_lower()[source]

Lowercased name of the model.