Transport Accessibility documentation master file, created by
sphinx-quickstart on Mon Jun  3 13:49:21 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Django database models representing the files of the GTFS Reference with all their fields

Agency, Stop, Route, Trip, StopTime, Calendar, CalendarDate, FareAttribute, FareRule, Shape, Frequency, Transfer, Pathway, Level, FeedInfo, Location, BookingRule, Translation, Attribution, LocationGroup, LocationGroupStop, RouteNetwork, Network, StopArea, Area, FareMedium, FareProduct, FareLegRule, FareTransferRule, Timeframe

A wrapper for a deferred-loading field. When the value is read from this
object the first time, the query is executed.

Accessor to the related objects manager on the reverse side of a
many-to-one relation.

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

``Parent.children`` is a ``ReverseManyToOneDescriptor`` instance.

Most of the implementation is delegated to a dynamically defined manager
class built by ``create_forward_many_to_many_manager()`` defined below.

class built by 

Accessor to the related object on the forward side of a many-to-one or
one-to-one (via ForwardOneToOneDescriptor subclass) relation.

docstring of pt_map.models.BookingRule.prior_notice_duration_max

docstring of pt_map.models.BookingRule.prior_notice_duration_min

Calendar.get_next_by_end_date(*, field=<django.db.models.fields.DateField: end_date>, is_next=True, **kwargs)

(*, field=<django.db.models.fields.DateField: end_date>, is_next=True, **kwargs)

Calendar.get_next_by_start_date(*, field=<django.db.models.fields.DateField: start_date>, is_next=True, **kwargs)

(*, field=<django.db.models.fields.DateField: start_date>, is_next=True, **kwargs)

Calendar.get_previous_by_end_date(*, field=<django.db.models.fields.DateField: end_date>, is_next=False, **kwargs)

(*, field=<django.db.models.fields.DateField: end_date>, is_next=False, **kwargs)

Calendar.get_previous_by_start_date(*, field=<django.db.models.fields.DateField: start_date>, is_next=False, **kwargs)

(*, field=<django.db.models.fields.DateField: start_date>, is_next=False, **kwargs)

CalendarDate.get_next_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=True, **kwargs)

(*, field=<django.db.models.fields.DateField: date>, is_next=True, **kwargs)

CalendarDate.get_previous_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=False, **kwargs)

(*, field=<django.db.models.fields.DateField: date>, is_next=False, **kwargs)

docstring of pt_map.models.FareLegRule.fare_leg_rule_description

Accessor to the related objects manager on the forward and reverse sides of
a many-to-many relation.

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

``Pizza.toppings`` and ``Topping.pizzas`` are ``ManyToManyDescriptor``
instances.

(*, field=<django.db.models.fields.IntegerField: fare_media_type>)

fare_transfer_rule_description (pt_map.models.FareTransferRule attribute)

docstring of pt_map.models.FareTransferRule.fare_transfer_rule_description

fare_transfer_rule_id (pt_map.models.FareTransferRule attribute)

docstring of pt_map.models.FareTransferRule.fare_transfer_rule_id

fare_transfer_rule_name (pt_map.models.FareTransferRule attribute)

docstring of pt_map.models.FareTransferRule.fare_transfer_rule_name

get_duration_limit_type_display() (pt_map.models.FareTransferRule method)

(*, field=<django.db.models.fields.CharField: duration_limit_type>)

get_fare_transfer_type_display() (pt_map.models.FareTransferRule method)

(*, field=<django.db.models.fields.CharField: fare_transfer_type>)

location_group_id_id (pt_map.models.LocationGroupStop attribute)

location_group_stop_id (pt_map.models.LocationGroupStop attribute)

docstring of pt_map.models.LocationGroupStop.location_group_stop_id

(*, field=<django.db.models.fields.IntegerField: continuous_drop_off>)

(*, field=<django.db.models.fields.IntegerField: continuous_pickup>)

fare_rules_for_zone_as_destination (pt_map.models.Stop attribute)

docstring of pt_map.models.Stop.fare_rules_for_zone_as_destination

get_continuous_drop_off_display() (pt_map.models.StopTime method)

(*, field=<django.db.models.fields.IntegerField: drop_off_type>)

docstring of pt_map.models.StopTime.start_pickup_drop_off_window

Test suite meant to make sure the models do their best to enforce compliance of the database with the gtfs standard.
In particular we are testing:
1. All of the txt files the reference suggests have a model representation.
2. All of the fields described in each of the files is representable inside the corresponding model.
3. The fields can be set with standard data for the correct data type.
4. None of the optional fields are enforced to be set. (TODO)
5. All of the required fields are enforced to be set with a legal value. (TODO)
6. If set, the optional fields hold only legal values (TODO)
7. All conditional requirements and restrictions are enforced. (TODO)
8. Foreign keys and many to many sets are actually set within the database and are validated. (TODO)

_get_test_data(f: function):
Decorator, wrapping instance methods to provide an extendable method to get data from the test data set based on the TestCase's requirements.

Decorator, wrapping instance methods to provide an extendable method to get data from the test data set based on the TestCase’s requirements.

_test_constructor(f: function):
Decorator. Basic test to validate if the models are instantiable with the given set of fields.

AllFieldsPresentTestCase(TestCase):
Test case making sure all files are represented with a complete set of fields. (Conditions 1+2 from the above list)

ConstructorAllFieldsTestCase(TestCase):
Test case making sure the models can be instantiated given valid values for all their fields. (3)

ConstructorRequiredFieldsOnlyTestCase(TestCase):
Test case making sure the model creation is fine with just the required fields. (4)

AllFieldsPresentTestCase (class in pt_map.tests_gtfs_compliance)

Test for the presence of all the fields of all the models, the GTFS reference describes.

setUp() (pt_map.tests_gtfs_compliance.AllFieldsPresentTestCase method)

Hook method for setting up the test fixture before exercising it.

Make sure the model has properties for all fields - regardless if required - provided by the GTFS standard.

ConstructorAllFieldsTestCase (class in pt_map.tests_gtfs_compliance)

Test all the models can be initialized using appropriate data as specified by the GTFS.

setUp() (pt_map.tests_gtfs_compliance.ConstructorAllFieldsTestCase method)

ConstructorRequiredFieldsOnlyTestCase (class in pt_map.tests_gtfs_compliance)

ConstructorRequiredFieldsOnlyTestCase.get_test_data(field, model, d, i)

Redirecting HTTP requests destined for the app pt_map to the correct views

"Stops": Json Representation of all stops found in the database
"Routes": Json Representation of all routes found in the database

“Stops”: Json Representation of all stops found in the database
“Routes”: Json Representation of all routes found in the database

Module to handle database IO while abstracting the specific SQL and django model filtering.

get_field_names(model: django.db.models.base.ModelBase) -> list[str]:
Return all the model's field names as a list of strings

get_pks_from_get(req_get: dict[str,str]) -> dict[django.db.models.base.ModelBase, list[str]]:
For given GET data return the primary keys requested mapped to the model classes

get_obj_by_pk(mdl: django.db.models.base.ModelBase, pks: list[str]) -> list[mdl]:
For a given model class and list of primary keys of that class, return the corresponding model objects.

obj_from_get(req_get: django dict-like request.GET) -> dict[django.db.base.models.ModelBase, list[models.Model]):
For given GET data, return a dict mapping the model classes to the requested instances.

get_trips(routes: list[pt_map.models.Route]) -> dict[str, list[pt_map.models.Trip]]:
For a list of Routes, return a dict mapping a list of all Trips associated with an individual Route, mapped to its route_id.

get_stop_sequences(routes: list[pt_map.models.Route], [trips: dict[str, list[pt_map.models.Trip]]]) -> dict[str, list[pt_map.models.Stop]]:
For a list of routes, return a dict mapping an ordered sequence of stops to the Routes route_id. If a dict of lists trips mapped to the respective route_ids is given, the first elements of each of those lists is used, otherwise it is calculated. If the trips argument is given, it is expected to hold a value for all the Routes in routes.

get_timetable(r: pt_map.models.Route, [trips_r: list[pt_map.models.Trip]], [stop_sequence: list[pt_map.models.Stop]]) -> :
Calculate a timetable for a Route r. If a list of trips for that route and/or a stop sequence is given, their first elements are used, otherwise all are calculated and the first elements are used.

get_all_stops() -> dict[str, dict[str, str]]:
Return a dict mapping all stop_ids in the database to a dict of relevant values.

get_all_routes() -> list[dict[str,str]]:
Return a list of dicts containing route_ids and other relevant values of all Routes in the database.

[
        {
            'route_id': pt_map.models.Route.route_id,
            'route_type': pt_map.models.Route.route_type,
            'route_name': pt_map.models.Route.route_short_name if set else pt_map.models.Route.route_long_name,
            'agency_id': pt_map.models.Route.agency_id.agency_id,
        }
]

{
    stop_id (str): {
            'stop_name': pt_map.models.Stop.stop_name,
            'stop_lat': pt_map.models.Stop.stop_lat,
            'stop_lon': pt_map.models.Stop.stop_lon,
        }
}

get_field_names(model: ~django.db.models.base.Model) -> list[str]

Given a model, returns a list of the name strings of all the model's fields.

Given a model, returns a list of the name strings of all the model’s fields.

get_obj_by_pk(mdl: ~django.db.models.base.ModelBase, pks: list[str]) -> list[~django.db.models.base.Model]

Given a model, and a list of corresponding primary keys, return a list of objects of the given model identified by the given primary keys.

mdl (django.db.models.base.ModelBase) -- Model class to look for

Exception -- mdl.DoesNotExist:: If at least one object from the list of pks could not be found.

mdl.DoesNotExist:: If at least one object from the list of pks could not be found.

get_pks_from_get(req_get: dict[str, str]) -> dict[~django.db.models.base.ModelBase, list[str]]

Extract primary keys from a request.GET dict-like and find the corresponding classes.

req_get (dict[str, str]) -- dict-like object, a HTTP Requests GET data.

get_stop_sequences(routes: list[~pt_map.models.Route], trips: dict[str, list[~pt_map.models.Trip]] = None) -> dict[str, list[str]]

routes: list[~pt_map.models.Route], trips: dict[str, list[~pt_map.models.Trip]] = None

For all given routes, return a list of stops in the order of appearance along the route. The first trip in the list of trips is used to define the sequence.

routes (list[pt_map.models.Route]) -- List of pt_map.models.Route to find stop sequences for.

trips (dict[str,list[pt_map.models.Trip]]) -- List of at least one trip for each Route in routes. If none, all are calculated and the first used for the sequence.

List of at least one trip for each Route in routes. If none, all are calculated and the first used for the sequence.

Keys:

route_ids.

Values:

Lists of stop_ids in the order of appearance in the first Trip in the routes' trips list given.

Values:

Lists of stop_ids in the order of appearance in the first Trip in the routes’ trips list given.

get_timetable(r: ~pt_map.models.Route, trips_r: list[~pt_map.models.Trip] = None, stop_sequence: list[str] = None)

r: ~pt_map.models.Route, trips_r: list[~pt_map.models.Trip] = None, stop_sequence: list[str] = None

Given a pt_map.models.Route, calculate the timetable for all its stops.

r (pt_map.models.Route) -- Route the timetable should be calculated for.

trips_r (list[pt_map.models.Trip]) -- Optional.
List of trips travelling on the Route r.

stop_sequence (list[str]) -- Optional.
List of stop_ids the Route r serves.
Currently the first trip is taken as reference for stops and sequence.

Optional.

Dict containing two elements:

"stop_sequence"

list(str):

list of stop_ids the route serves.

"stop_times"

dict(str, list(str)):

dict mapping stop_ids from stop_sequence to time strings the route is serving the stop at.

"stop_sequence" : list(str):
    list of stop_ids the route serves.
"stop_times" : dict(str, list(str)):
    dict mapping stop_ids from stop_sequence to time strings the route is serving the stop at.

dict{"stop_sequence": list(str), "stop_times": dict[str, list(str)]}

get_trips(routes: list[~pt_map.models.Route]) -> dict[str, list[~pt_map.models.Trip]]

Return a list of all Trips associated with a Route in the argument.

routes (list[str]:) -- List of primary keys for the Routes to search the trips for.

Keys: route_ids from parameter.
Values: lists of corresponding trip objects.

obj_from_get(req_get: dict[str, str]) -> dict[~django.db.models.base.ModelBase, list[~django.db.models.base.Model]]

Given the GET data of a HTTP Request, return a dict with the requested model classes as keys and lists of the requested model objects as values.

dependencies (pt_map.migrations.0001_initial.Migration attribute)

dependencies (pt_map.migrations.0002_initial.Migration attribute)

[<CreateModel  name='Agency', fields=[('agency_id', <django.db.models.fields.CharField>), ('agency_name', <django.db.models.fields.CharField>), ('agency_url', <django.db.models.fields.URLField>), ('agency_timezone', <django.db.models.fields.CharField>), ('agency_lang', <django.db.models.fields.CharField>), ('agency_phone', <django.db.models.fields.CharField>), ('agency_fare_url', <django.db.models.fields.URLField>), ('agency_email', <django.db.models.fields.EmailField>)]>, <CreateModel  name='FareProduct', fields=[('fare_product_id', <django.db.models.fields.BigAutoField>), ('fare_product_name', <django.db.models.fields.CharField>), ('fare_product_description', <django.db.models.fields.TextField>), ('amount', <django.db.models.fields.FloatField>), ('curreny', <django.db.models.fields.CharField>)]>, <CreateModel  name='FeedInfo', fields=[('feed_id', <django.db.models.fields.BigAutoField>), ('feed_publisher_name', <django.db.models.fields.CharField>), ('feed_publisher_url', <django.db.models.fields.URLField>), ('feed_lang', <django.db.models.fields.CharField>), ('default_lang', <django.db.models.fields.CharField>), ('feed_start_date', <django.db.models.fields.DateField>), ('feed_end_date', <django.db.models.fields.DateField>), ('feed_version', <django.db.models.fields.CharField>), ('feed_contact_email', <django.db.models.fields.EmailField>), ('feed_contact_url', <django.db.models.fields.URLField>)]>, <CreateModel  name='FareAttribute', fields=[('fare_id', <django.db.models.fields.CharField>), ('price', <django.db.models.fields.FloatField>), ('currency_type', <django.db.models.fields.CharField>), ('payment_method', <django.db.models.fields.IntegerField>), ('transfers', <django.db.models.fields.IntegerField>), ('transfer_duration', <django.db.models.fields.IntegerField>), ('agency_id', <django.db.models.fields.related.ForeignKey>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='FareTransferRule', fields=[('fare_transfer_rule_id', <django.db.models.fields.CharField>), ('fare_transfer_rule_name', <django.db.models.fields.CharField>), ('fare_transfer_rule_description', <django.db.models.fields.TextField>), ('from_leg_group_id', <django.db.models.fields.IntegerField>), ('to_leg_group_id', <django.db.models.fields.IntegerField>), ('fare_product_id', <django.db.models.fields.related.ForeignKey>)]>, <AddField  model_name='fareproduct', name='feed_info_id', field=<django.db.models.fields.related.ForeignKey>>, <CreateModel  name='FareMedium', fields=[('fare_media_id', <django.db.models.fields.CharField>), ('fare_media_name', <django.db.models.fields.CharField>), ('fare_media_description', <django.db.models.fields.TextField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='Calendar', fields=[('service_id', <django.db.models.fields.CharField>), ('monday', <django.db.models.fields.BooleanField>), ('tuesday', <django.db.models.fields.BooleanField>), ('wednesday', <django.db.models.fields.BooleanField>), ('thursday', <django.db.models.fields.BooleanField>), ('friday', <django.db.models.fields.BooleanField>), ('saturday', <django.db.models.fields.BooleanField>), ('sunday', <django.db.models.fields.BooleanField>), ('start_date', <django.db.models.fields.DateField>), ('end_date', <django.db.models.fields.DateField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='Area', fields=[('area_id', <django.db.models.fields.CharField>), ('area_name', <django.db.models.fields.CharField>), ('area_description', <django.db.models.fields.TextField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>)]>, <AddField  model_name='agency', name='feed_info_id', field=<django.db.models.fields.related.ForeignKey>>, <CreateModel  name='Level', fields=[('level_id', <django.db.models.fields.CharField>), ('level_index', <django.db.models.fields.FloatField>), ('level_name', <django.db.models.fields.CharField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='LocationGroup', fields=[('location_group_id', <django.db.models.fields.CharField>), ('location_group_name', <django.db.models.fields.CharField>), ('location_group_type', <django.db.models.fields.CharField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='LocationsGeojson', fields=[('location_id', <django.db.models.fields.CharField>), ('location_name', <django.db.models.fields.CharField>), ('location_lat', <django.db.models.fields.FloatField>), ('location_lon', <django.db.models.fields.FloatField>), ('location_type', <django.db.models.fields.CharField>), ('parent_location_id', <django.db.models.fields.CharField>), ('wheelchair_boarding', <django.db.models.fields.BooleanField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='Network', fields=[('network_id', <django.db.models.fields.CharField>), ('network_name', <django.db.models.fields.CharField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='Route', fields=[('route_id', <django.db.models.fields.CharField>), ('route_short_name', <django.db.models.fields.CharField>), ('route_long_name', <django.db.models.fields.CharField>), ('route_desc', <django.db.models.fields.TextField>), ('route_type', <django.db.models.fields.IntegerField>), ('route_url', <django.db.models.fields.URLField>), ('route_color', <django.db.models.fields.CharField>), ('route_text_color', <django.db.models.fields.CharField>), ('route_sort_order', <django.db.models.fields.IntegerField>), ('continuous_pickup', <django.db.models.fields.IntegerField>), ('continuous_drop_off', <django.db.models.fields.IntegerField>), ('agency_id', <django.db.models.fields.related.ForeignKey>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='FareRule', fields=[('fare_rule_id', <django.db.models.fields.BigAutoField>), ('origin_id', <django.db.models.fields.IntegerField>), ('destination_id', <django.db.models.fields.CharField>), ('contains_id', <django.db.models.fields.CharField>), ('fare_id', <django.db.models.fields.related.ForeignKey>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>), ('route_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='RouteNetwork', fields=[('route_network_id', <django.db.models.fields.CharField>), ('route_network_name', <django.db.models.fields.CharField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>), ('network_id', <django.db.models.fields.related.ForeignKey>), ('route_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='Shape', fields=[('shape_pk', <django.db.models.fields.BigAutoField>), ('shape_id', <django.db.models.fields.CharField>), ('shape_pt_lat', <django.db.models.fields.FloatField>), ('shape_pt_lon', <django.db.models.fields.FloatField>), ('shape_pt_sequence', <django.db.models.fields.IntegerField>), ('shape_dist_traveled', <django.db.models.fields.FloatField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>)], options={'unique_together': {('shape_id', 'shape_pt_sequence')}}>, <CreateModel  name='Stop', fields=[('stop_id', <django.db.models.fields.CharField>), ('stop_code', <django.db.models.fields.CharField>), ('stop_name', <django.db.models.fields.CharField>), ('stop_desc', <django.db.models.fields.TextField>), ('stop_lat', <django.db.models.fields.FloatField>), ('stop_lon', <django.db.models.fields.FloatField>), ('zone_id', <django.db.models.fields.CharField>), ('stop_url', <django.db.models.fields.URLField>), ('location_type', <django.db.models.fields.IntegerField>), ('stop_timezone', <django.db.models.fields.CharField>), ('wheelchair_boarding', <django.db.models.fields.IntegerField>), ('platform_code', <django.db.models.fields.CharField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>), ('level_id', <django.db.models.fields.related.ForeignKey>), ('parent_station', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='Pathway', fields=[('pathway_id', <django.db.models.fields.CharField>), ('pathway_mode', <django.db.models.fields.IntegerField>), ('is_bidirectional', <django.db.models.fields.IntegerField>), ('length', <django.db.models.fields.FloatField>), ('traversal_time', <django.db.models.fields.IntegerField>), ('stair_count', <django.db.models.fields.IntegerField>), ('max_slope', <django.db.models.fields.FloatField>), ('min_width', <django.db.models.fields.FloatField>), ('signposted_as', <django.db.models.fields.CharField>), ('reversed_signposted_as', <django.db.models.fields.CharField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>), ('from_stop_id', <django.db.models.fields.related.ForeignKey>), ('to_stop_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='LocationGroupStop', fields=[('location_group_stop_id', <django.db.models.fields.BigAutoField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>), ('location_group_id', <django.db.models.fields.related.ForeignKey>), ('stop_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='StopArea', fields=[('stop_area_id', <django.db.models.fields.CharField>), ('stop_area_name', <django.db.models.fields.CharField>), ('stop_area_description', <django.db.models.fields.TextField>), ('area_id', <django.db.models.fields.related.ForeignKey>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>), ('stop_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='Timeframe', fields=[('timeframe_group_id', <django.db.models.fields.CharField>), ('service_id', <django.db.models.fields.IntegerField>), ('start_date', <django.db.models.fields.DateField>), ('end_date', <django.db.models.fields.DateField>), ('start_time', <django.db.models.fields.TimeField>), ('end_time', <django.db.models.fields.TimeField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='FareLegRule', fields=[('fare_leg_rule_id', <django.db.models.fields.CharField>), ('fare_leg_rule_name', <django.db.models.fields.CharField>), ('fare_leg_rule_description', <django.db.models.fields.TextField>), ('from_area_id', <django.db.models.fields.related.ForeignKey>), ('to_area_id', <django.db.models.fields.related.ForeignKey>), ('fare_product_id', <django.db.models.fields.related.ForeignKey>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>), ('network_id', <django.db.models.fields.related.ForeignKey>), ('from_timeframe_group_id', <django.db.models.fields.related.ForeignKey>), ('to_timeframe_group_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='Translation', fields=[('translation_id', <django.db.models.fields.BigAutoField>), ('table_name', <django.db.models.fields.CharField>), ('field_name', <django.db.models.fields.CharField>), ('language', <django.db.models.fields.CharField>), ('translation', <django.db.models.fields.TextField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='Trip', fields=[('trip_id', <django.db.models.fields.CharField>), ('service_id', <django.db.models.fields.IntegerField>), ('trip_headsign', <django.db.models.fields.CharField>), ('trip_short_name', <django.db.models.fields.CharField>), ('direction_id', <django.db.models.fields.IntegerField>), ('block_id', <django.db.models.fields.CharField>), ('wheelchair_accessible', <django.db.models.fields.IntegerField>), ('bikes_allowed', <django.db.models.fields.IntegerField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>), ('route_id', <django.db.models.fields.related.ForeignKey>), ('shape_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='Frequency', fields=[('frequency_id', <django.db.models.fields.BigAutoField>), ('start_time', <django.db.models.fields.TimeField>), ('end_time', <django.db.models.fields.TimeField>), ('headway_secs', <django.db.models.fields.IntegerField>), ('exact_times', <django.db.models.fields.IntegerField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>), ('trip_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='BookingRule', fields=[('booking_rule_id', <django.db.models.fields.CharField>), ('start_time', <django.db.models.fields.TimeField>), ('end_time', <django.db.models.fields.TimeField>), ('booking_type', <django.db.models.fields.CharField>), ('rule_criteria', <django.db.models.fields.TextField>), ('booking_rule_instructions', <django.db.models.fields.TextField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>), ('trip_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='Attribution', fields=[('attribution_id', <django.db.models.fields.BigAutoField>), ('attribution_name', <django.db.models.fields.CharField>), ('attribution_url', <django.db.models.fields.URLField>), ('attribution_email', <django.db.models.fields.EmailField>), ('attribution_phone', <django.db.models.fields.CharField>), ('agency_id', <django.db.models.fields.related.ForeignKey>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>), ('route_id', <django.db.models.fields.related.ForeignKey>), ('trip_id', <django.db.models.fields.related.ForeignKey>)]>, <CreateModel  name='CalendarDate', fields=[('calendar_date_id', <django.db.models.fields.BigAutoField>), ('service_id', <django.db.models.fields.CharField>), ('date', <django.db.models.fields.DateField>), ('exception_type', <django.db.models.fields.IntegerField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>)], options={'unique_together': {('service_id', 'date')}}>, <CreateModel  name='Transfer', fields=[('transfer_id', <django.db.models.fields.BigAutoField>), ('transfer_type', <django.db.models.fields.IntegerField>), ('min_transfer_time', <django.db.models.fields.IntegerField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>), ('from_route_id', <django.db.models.fields.related.ForeignKey>), ('from_stop_id', <django.db.models.fields.related.ForeignKey>), ('to_route_id', <django.db.models.fields.related.ForeignKey>), ('to_stop_id', <django.db.models.fields.related.ForeignKey>), ('from_trip_id', <django.db.models.fields.related.ForeignKey>), ('to_trip_id', <django.db.models.fields.related.ForeignKey>)], options={'unique_together': {('from_stop_id', 'to_stop_id')}}>, <CreateModel  name='StopTime', fields=[('stop_time_id', <django.db.models.fields.BigAutoField>), ('arrival_time', <django.db.models.fields.TimeField>), ('departure_time', <django.db.models.fields.TimeField>), ('stop_sequence', <django.db.models.fields.IntegerField>), ('stop_headsign', <django.db.models.fields.CharField>), ('pickup_type', <django.db.models.fields.IntegerField>), ('drop_off_type', <django.db.models.fields.IntegerField>), ('shape_dist_traveled', <django.db.models.fields.FloatField>), ('timepoint', <django.db.models.fields.IntegerField>), ('feed_info_id', <django.db.models.fields.related.ForeignKey>), ('location_group_id', <django.db.models.fields.related.ForeignKey>), ('location_id', <django.db.models.fields.related.ForeignKey>), ('stop_id', <django.db.models.fields.related.ForeignKey>), ('trip_id', <django.db.models.fields.related.ForeignKey>)], options={'unique_together': {('trip_id', 'stop_sequence')}}>]

Migration (class in pt_map.migrations.0003_faretransferrule_feed_info_id)

[<AddField  model_name='faretransferrule', name='feed_info_id', field=<django.db.models.fields.related.ForeignKey>, preserve_default=False>]

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/

https://docs.djangoproject.com/en/5.0/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.0/ref/settings/

It exposes the WSGI callable as a module-level variable named ``application``.

https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/

data
Serves api/models/
GET:
Fetches models given their primary keys
PUT:
Creates new model objects or updates them with complete representations. If object with the given primary keys exist, they will be deleted and replaced.
PATCH:
Updates models, identified by their primary keys without deleting them. Can be incomplete representations.
DELETE:
Deletes models, identified by their primary keys.

GET:
PUT:
PATCH:
DELETE:

Handle database requests from the frontend. Using Http semantics to specify what to do with the data.

PUT
Create a new object if no object with the given primary key exists in the database or delete and replace an existing object.
Body must be a json dict of lists of fully specified, valid models. Primary keys can be omitted and will be ignored if the element does not exist in the database.
If primary keys are given, the elements are deleted and replaced. Note that if there is an error in creating the new object, the object to replace will still probably already have been deleted.
Successful response is 200 with a list of primary keys of the created and replaced objects.

PATCH
Modify an existing objects given the instructions in the body.
Body must be a json dict of lists of fields to change and their valid values existing objects in the database, identified by their valid primary keys.
Responds 400 if any of the primary keys given does not exist.
Successful response is 200 with a list of the primary keys of the modified objects.

GET
Return json of models identified by primary keys.
Responds 400 if any of the requested pks does not exist.

DELETE
Delete models with given primary keys if they exist.
Responds 400 if any of the primary keys given does not exist in the database.
Successful response is 200 and the number of deleted models.

GET:
Find timetables for all routes passed via GET.
Successful response is a Json representation of a dict of timetables in the following form:

{
    route_id (from GET): {
        'stop_sequence': [stop_ids for all stops the route server, in order],
        'stop_times': {
    stop_id (from stop_sequence): [str in the format HH:MM representing stop times]
    }
}