intranet.apps.bus package

Submodules

intranet.apps.bus.admin module

intranet.apps.bus.api module

class intranet.apps.bus.api.RouteDetail(**kwargs)[source]

Bases: rest_framework.generics.RetrieveAPIView

API endpoint that retrieves information about a specific bus route.

/api/bus/<num>: retrieve information about bus number <num>

get_queryset()[source]
permission_classes = (<class 'intranet.apps.auth.rest_permissions.DenyRestrictedPermission'>,)
serializer_class

alias of intranet.apps.bus.serializers.RouteSerializer

class intranet.apps.bus.api.RouteList(**kwargs)[source]

Bases: rest_framework.generics.ListAPIView

API endpoint that retrieves information about buses.

/api/bus: retrieve a list of all buses

/api/bus/num: retrieve information about bus number num

get_queryset()[source]
permission_classes = (<class 'intranet.apps.auth.rest_permissions.DenyRestrictedPermission'>,)
serializer_class

alias of intranet.apps.bus.serializers.RouteSerializer

intranet.apps.bus.consumers module

class intranet.apps.bus.consumers.BusConsumer(*args, **kwargs)[source]

Bases: channels.generic.websocket.JsonWebsocketConsumer

bus_update(event)[source]
connect()[source]
groups = ['bus']
receive_json(content)[source]
within_time_range(time)[source]

intranet.apps.bus.models module

class intranet.apps.bus.models.Route(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A bus route (e.g. TJ-24)

ARRIVAL_STATUSES = (('a', 'Arrived (In the lot)'), ('d', 'Delayed'), ('o', 'On Time (Expected)'))
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

bus_number

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

get_status_display(*, field=<django.db.models.fields.CharField: status>)
id

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

objects = <django.db.models.manager.Manager object>
reset_status()[source]

Reset status to (on time)

route_name

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

space

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

status

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

user_set

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

In the example:

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.

intranet.apps.bus.serializers module

class intranet.apps.bus.serializers.RouteSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]

Bases: rest_framework.serializers.Serializer

class Meta[source]

Bases: object

fields = ('id', 'route_name', 'space', 'bus_number', 'status')
model

alias of intranet.apps.bus.models.Route

intranet.apps.bus.tasks module

intranet.apps.bus.tests module

class intranet.apps.bus.tests.BusTest(methodName='runTest')[source]

Bases: intranet.test.ion_test.IonTestCase

Test for bus module

test_bus()[source]
test_route_representation()[source]
test_routes()[source]

intranet.apps.bus.urls module

intranet.apps.bus.views module

Module contents