intranet.apps.bus package

Subpackages

Submodules

intranet.apps.bus.admin module

intranet.apps.bus.api module

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

Bases: 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.ApiAndOauthPermission'>,)
serializer_class

alias of RouteSerializer

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

Bases: 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.ApiAndOauthPermission'>,)
serializer_class

alias of RouteSerializer

intranet.apps.bus.consumers module

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

Bases: 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.BusAnnouncement(*args, **kwargs)[source]

Bases: Model

Announcement on the bus page. Only one instance of this model is allowed.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

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

message

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

classmethod object()[source]
objects = <django.db.models.manager.Manager object>
save(*args, **kwargs)[source]
class intranet.apps.bus.models.Route(*args, **kwargs)[source]

Bases: Model

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

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

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: 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(*args, **kwargs)[source]

Bases: Serializer

class Meta[source]

Bases: object

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

alias of Route

intranet.apps.bus.tasks module

intranet.apps.bus.tests module

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

Bases: 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