Welcome to Ulimi Time Tracker’s documentation!¶
This is a complete list of functions and classes. automatically generated by sphinx. You can search by index or modules.
Indices and tables¶
-
class
vms.views.
ClientAdminInviteAcceptView
(**kwargs)[source]¶ Accept in invitation to become an admin for a client.
-
form_class
¶
-
-
class
vms.views.
ClientCreateView
(**kwargs)[source]¶ Create a new client company.
-
form_class
¶ alias of
vms.forms.ClientCreateForm
-
-
class
vms.views.
ClientDetailView
(**kwargs)[source]¶ Retrieve information about a specific client.
-
class
vms.views.
ClientJobCreateView
(**kwargs)[source]¶ -
form_class
¶ alias of
vms.forms.ClientJobCreate
-
-
class
vms.views.
ClientJobDetailView
(**kwargs)[source]¶ View or update the details of a specific client job.
-
class
vms.views.
ClientJobListView
[source]¶ List the jobs for a particular client.
-
get_context_data
(*, object_list=None, **kwargs)[source]¶ Get the context to render the template with.
- Args:
- object_list:
- The list of client jobs rendered by the view.
- **kwargs:
- Additional context variables for the template.
- Returns:
- A dictionary containing the context used to render the view’s template.
-
-
class
vms.views.
ClockInView
(**kwargs)[source]¶ View for clocking in.
-
form_class
¶ alias of
vms.forms.ClockInForm
-
-
class
vms.views.
ClockOutView
(**kwargs)[source]¶ View for clocking out.
-
form_class
¶ alias of
vms.forms.ClockOutForm
-
-
class
vms.views.
EmployeeApplyView
(**kwargs)[source]¶ Apply a staffing agency employee to a client company.
-
form_class
¶ alias of
vms.forms.EmployeeApplyForm
-
form_valid
(form)[source]¶ Save the form and redirect back to the staffing agency detail view.
- Args:
- form:
- The form to save.
- Returns:
- A response redirecting the user to the staffing agency’s detail view.
-
-
class
vms.views.
EmployeeApproveView
(**kwargs)[source]¶ Can link a supervisor to an approved employee.
-
form_class
¶ alias of
vms.forms.EmployeeApprovalForm
-
-
class
vms.views.
EmployeeDetailView
(**kwargs)[source]¶ View the details of a single employee.
-
class
vms.views.
PendingEmployeesView
(**kwargs)[source]¶ Can see the list of pending employees that need to be approved or stopped
-
class
vms.views.
StaffingAgencyDetailView
(**kwargs)[source]¶ Retrieve information about a specific staffing agency.
-
class
vms.views.
StaffingAgencyEmployeeApproveView
(**kwargs)[source]¶ Approve an employee who has applied to a staffing agency.
-
form_class
¶
-
-
class
vms.views.
StaffingAgencyEmployeeCreateView
(**kwargs)[source]¶ Apply as an employee to a staffing agency.
-
form_class
¶
-
-
class
vms.views.
StaffingAgencyEmployeeDetailView
(**kwargs)[source]¶
-
class
vms.views.
StaffingAgencyEmployeePendingListView
(*args, **kwargs)[source]¶ List the pending employees for a staffing agency.
-
class
vms.views.
TimeRecordApproveView
(**kwargs)[source]¶ Approve a specific time record.
-
form_class
¶ alias of
vms.forms.TimeRecordApprovalForm
-
form_valid
(form)[source]¶ Save the form and redirect back to the hours approval page.
- Args:
- form:
- The valid form instance to save.
- Returns:
- A redirect response. If a ‘next’ parameter is provided in the URL, the user is taken to that URL. Otherwise they are taken to the list of unapproved hours for the client who owns the time record that was just approved.
-
-
class
vms.views.
UnapprovedTimeRecordListView
(**kwargs)[source]¶ List all the unapproved time records for a specific client.
-
class
vms.models.
Client
(*args, **kwargs)[source]¶ A client is a company that employees perform work for.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
get_absolute_url
()[source]¶ Get the URL of the instance’s detail view.
- Returns:
- The absolute URL of the instance’s detail view.
-
job_list_url
¶ Get the URL of the client’s job list.
- Returns:
- The URL of the view where all the client’s jobs are listed.
-
unapproved_time_record_list_url
¶ Get the URL of the client’s unapproved time record list.
- Returns:
- The absolute URL of the view to list the client’s unapproved time records.
-
exception
-
class
vms.models.
ClientAdmin
(*args, **kwargs)[source]¶ A link between a user and a client that grants the linked user admin permissions on the associated client company.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
exception
-
class
vms.models.
ClientAdminInvite
(*args, **kwargs)[source]¶ An invitation for a user to become a client admin.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
accept
(user)[source]¶ Accept the invitation.
- Args:
- user:
- The user who accepted the invitation.
- Returns:
- The created client admin.
-
accept_url
¶ - Returns:
- The absolute URL of the view to accept the invite.
-
exception
-
class
vms.models.
ClientJob
(*args, **kwargs)[source]¶ A type of task that can be worked on for a specific client.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
exception
-
class
vms.models.
Employee
(*args, **kwargs)[source]¶ An employee working for a specific company.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
approve
(admin)[source]¶ Approve the employee’s request to join the client.
- Args:
- admin:
- The client admin who approved the request.
-
approve_url
¶ - Returns:
- The absolute URL of the view used to approve the employee.
-
clock_in_url
¶ - Returns:
- The absolute URL of the view used to clock in the employee.
-
clock_out_url
¶ - Returns:
- The absolute URL of the view used to clock out the employee.
-
is_clocked_in
¶ Determine if the employee is currently clocked in.
- Returns:
- A boolean indicating if the employee is clocked in.
-
total_time
¶ Get the total time that the employee has logged.
- Returns:
- The total time the employee has worked, in seconds.
-
exception
-
class
vms.models.
StaffingAgency
(*args, **kwargs)[source]¶ A company that provides employees to clients.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
exception
-
class
vms.models.
StaffingAgencyAdmin
(*args, **kwargs)[source]¶ A link between a user and a staffing agency that grants the linked user admin permissions on the associated staffing agency.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
exception
-
class
vms.models.
StaffingAgencyEmployee
(*args, **kwargs)[source]¶ An employee who is contracted out by a staffing agency.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
exception
-
class
vms.models.
TimeRecord
(*args, **kwargs)[source]¶ A record marking a work period for an employee.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
approval_url
¶ Get the URL of the view used to approve the time record.
- Returns:
- The absolute URL of the view used to approve the time record.
-
is_approved
¶ Determine if the time record is approved.
- Returns:
- A boolean indicating if there is an approval record for the time record.
-
projected_earnings
¶ Get the projected earning from this time record.
- Returns:
- The total time multiplied by the pay rate for this job.
-
total_time
¶ Get the total time from this time record. Returns:
The time delta between start time and end time or delta of 0 if no end time.
-
exception
-
class
vms.models.
TimeRecordApproval
(*args, **kwargs)[source]¶ A record of the approval for a time record.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
exception
-
vms.models.
generate_slug
(value, queryset, slug_dest='slug')[source]¶ Generate and save a unique slug for the provided instance.
- Args:
- value:
- The value to slugify.
- queryset:
- The queryset to search to ensure the generated slug is unique.
- slug_dest:
- The name of the attribute on the instance that the slug is saved to.
-
vms.models.
generate_token
()[source]¶ Generate a random token.
- Returns:
- A random 16-character alphanumeric string.
-
class
vms.mixins.
DateRangeMixin
[source]¶ Mixin providing functionality for filtering by a date range.
The starting and ending times are specified as GET parameters.
-
end_date
¶ - Returns:
The end date provided in the URL. If both a start and end date are specified and the end date is prior to the start date, the start date is returned instead.
Note the end date is specified as a datetime so that we can include results for the entire day. This results in an inclusive bound which is more intuitive.
-
filter_by_date
(queryset, start_attr='time_start', end_attr='time_end')[source]¶ Filter a queryset based on a date range.
If either bound is not provided, it is not restricted.
- Args:
- queryset:
- The queryset to filter.
- start_attr:
- The attribute on the queryset that should be compared to the start time given in the URL.
- end_attr:
- The attribute on the queryset that should be compared to the end time given in the URL.
- Returns:
- The provided queryset filtered such that no record’s
start_attr
is before the start time in the URL and no record’send_attr
is after the end time in the URL.
-
get_context_data
(**kwargs)[source]¶ Add date context to the view.
- Args:
- **kwargs:
- Keyword arguments to pass to the base method.
- Returns:
- A dictionary containing context used to render the view.
-
start_date
¶ - Returns:
- The start date provided in the URL as a datetime instance.
-
-
vms.time_utils.
round_time_worked
(time_worked, block_size=900)[source]¶ Round a period of time worked to the nearest block.
Typically this is used to round time worked to the closest 15 minute block.
- Args:
- time_worked:
- The time period to round, in seconds.
- block_size:
- The block size to round to, in seconds. Defaults to 15 minutes.
- Returns:
- The time worked, in seconds, rounded to the nearest block.
-
class
vms.managers.
TimeRecordQuerySet
(model=None, query=None, using=None, hints=None)[source]¶ -
total_time
()[source]¶ Get the total duration of the time records in the queryset.
- Returns:
- The total duration of the time records in the queryset
expressed as a
datetime.timedelta
instance.
-
with_deltas
()[source]¶ Annotate the queryset to include a delta for each time record.
Because computing a delta relies on
time_end
being present, time records that have not been completed are excluded.- Returns:
- A queryset annotated such that each time record has a
delta
attribute containing the delta between the record’stime_start
andtime_end
.
-
-
vms.id_utils.
generate_numeric_id
(num_digits)[source]¶ Generate a numeric ID with the provided number of digits.
- Args:
- num_digits:
- The number of digits present in the returned ID.
- Returns:
- A random ID with the specified number of digits.
-
vms.id_utils.
generate_unique_id
(digits, queryset, queryset_attr='id')[source]¶ Generate a unique ID for a given queryset.
The provided ID is guaranteed to be unique for the provided queryset.
warning ..
There is still a race condition between when the value is returned from the function and when it is saved to an instance.- Args:
- digits:
- The number of digits in the returned ID.
- queryset:
- The queryset used to check for uniqueness.
- queryset_attr:
- The attribute of the queryset to check for uniqueness.
Defaults to
id
.
- Returns:
- A unique ID for the provided queryset of objects.
-
class
vms.forms.
ClientAdminInviteAcceptForm
(token, *args, **kwargs)[source]¶ Form to accept an invitation to become a client admin.
-
class
vms.forms.
ClientCreateForm
(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]¶ Form to create a new client.
Once the form is saved, a new client company is saved, and an email invitation to become an admin for the client is sent to the provided email address.
-
class
vms.forms.
ClockInForm
(employee, *args, **kwargs)[source]¶ Form to clock in the requesting user.
-
class
vms.forms.
ClockOutForm
(employee, *args, **kwargs)[source]¶ Form to clock out an employee.
-
class
vms.forms.
EmployeeApplyForm
(staffing_agency, user, *args, **kwargs)[source]¶ Form for applying an employee to a client company.
-
class
vms.forms.
EmployeeApprovalForm
(employee, *args, **kwargs)[source]¶ Form to link Employee to Supervisor
-
class
vms.forms.
StaffingAgencyEmployeeApprovalForm
(employee, admin, *args, **kwargs)[source]¶ Form to approve a staff employee
-
class
vms.forms.
StaffingAgencyEmployeeCreateForm
(user, *args, **kwargs)[source]¶ Form to create a staffing agency employee.
-
class
vms.forms.
TimeRecordApprovalForm
(time_record, approving_user, *args, **kwargs)[source]¶ Form to approve a time record.
-
vms.api.dialogflow.
clock_in
(client_id, employee_id, project_id=None)[source]¶ Clock in an employee.
- Args:
- client_id:
- The ID of the client the employee works for.
- employee_id:
- The ID of the employee who is clocking in.
- project_id:
- The ID of the project the employee is working on.
- Returns:
- A response indicating the result of the clock in request.
-
vms.api.dialogflow.
clock_out
(client_id, employee_id)[source]¶ Clock out the employee with the provided information.
- Args:
- client_id:
- The ID of the client that the employee who is clocking out works for.
- employee_id:
- The ID of the employee to clock out.
- Returns:
- A string describing the result of the clock out request.
-
vms.api.dialogflow.
list_projects
(client_id)[source]¶ Enumerate the projects for a client.
- Args:
- client_id:
- The ID of the client company whose projects should be listed.
- Returns:
- A string message enumerating the projects.
-
vms.api.dialogflow.
process
(data)[source]¶ Fulfill a webhook request from Dialogflow.
- Args:
- data:
- The data received from Dialogflow.
- Returns:
- A dictionary containing the data to return to Dialogflow.
-
class
vms.api.serializers.
DialogflowWebhookSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Serializer to handle a request from Dialogflow.
-
class
vms.api.serializers.
IntentSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Serializer to handle information about the intent triggered by Dialogflow.
-
class
vms.api.serializers.
QuerySerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Serializer to handle the query parameters for a Dialogflow fulfillment request.
-
class
account.managers.
UserManager
[source]¶ Manager object for custom user class.
-
class
account.middleware.
TimezoneMiddleware
(get_response)[source]¶ Class to set the timezone for each request.
-
class
account.models.
User
(*args, **kwargs)[source]¶ A single user.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
exception
-
class
account.views.
SignUpView
(**kwargs)[source]¶ View to register new users.
-
form_class
¶ alias of
account.forms.SignUpForm
-