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>
- 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
- permission_classes = (<class 'intranet.apps.auth.rest_permissions.ApiAndOauthPermission'>,)¶
- serializer_class¶
alias of
RouteSerializer
intranet.apps.bus.consumers module¶
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.
- objects = <django.db.models.manager.Manager object>¶
- 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>¶
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.