2951 lines
119 KiB
YAML
2951 lines
119 KiB
YAML
metadata:
|
||
system_name: Haikal
|
||
version: '1.0'
|
||
generated_from: Django
|
||
features:
|
||
auth_login:
|
||
description: 'Persist a user id and a backend in the request. This way a user
|
||
doesn''t
|
||
|
||
have to reauthenticate on every request. Note that data set during
|
||
|
||
the anonymous session is retained when the user logs in.'
|
||
source: django.contrib.auth.views.auth_login
|
||
type: view_function
|
||
auth_logout:
|
||
description: 'Remove the authenticated user''s ID from the request and flush their
|
||
session
|
||
|
||
data.'
|
||
source: django.contrib.auth.views.auth_logout
|
||
type: view_function
|
||
csrf_protect:
|
||
description: 'This decorator adds CSRF protection in exactly the same way as
|
||
|
||
CsrfViewMiddleware, but it can be used on a per view basis. Using both, or
|
||
|
||
using the decorator multiple times, is harmless and efficient.'
|
||
source: django.contrib.auth.views.csrf_protect
|
||
type: view_function
|
||
get_current_site:
|
||
description: 'Check if contrib.sites is installed and return either the current
|
||
|
||
``Site`` object or a ``RequestSite`` object based on the request.'
|
||
source: allauth.socialaccount.views.get_current_site
|
||
type: view_function
|
||
get_user_model:
|
||
description: Return the User model that is active in this project.
|
||
source: appointment.views.get_user_model
|
||
type: view_function
|
||
login_not_required:
|
||
description: Decorator for views that allows access to unauthenticated requests.
|
||
source: debug_toolbar.views.login_not_required
|
||
type: view_function
|
||
login_required:
|
||
description: 'Decorator for views that checks that the user is logged in, redirecting
|
||
|
||
to the log-in page if necessary.'
|
||
source: allauth.socialaccount.views.login_required
|
||
type: view_function
|
||
logout_then_login:
|
||
description: Log out the user if they are logged in. Then redirect to the login
|
||
page.
|
||
source: django.contrib.auth.views.logout_then_login
|
||
type: view_function
|
||
method_decorator:
|
||
description: Convert a function decorator into a method decorator
|
||
source: allauth.socialaccount.providers.google.views.method_decorator
|
||
type: view_function
|
||
never_cache:
|
||
description: Decorator that adds headers to a response so that it will never be
|
||
cached.
|
||
source: allauth.account.views.never_cache
|
||
type: view_function
|
||
redirect_to_login:
|
||
description: Redirect the user to the login page, passing the given 'next' page.
|
||
source: django.contrib.auth.views.redirect_to_login
|
||
type: view_function
|
||
resolve_url:
|
||
description: "Return a URL appropriate for the arguments passed.\n\nThe arguments\
|
||
\ could be:\n\n * A model: the model's `get_absolute_url()` function will\
|
||
\ be called.\n\n * A view name, possibly with arguments: `urls.reverse()`\
|
||
\ will be used\n to reverse-resolve the name.\n\n * A URL, which will\
|
||
\ be returned as-is."
|
||
source: django.contrib.auth.views.resolve_url
|
||
type: view_function
|
||
sensitive_post_parameters:
|
||
description: "Indicate which POST parameters used in the decorated view are sensitive,\n\
|
||
so that those parameters can later be treated in a special way, for example\n\
|
||
by hiding them when logging unhandled exceptions.\n\nAccept two forms:\n\n*\
|
||
\ with specified parameters:\n\n @sensitive_post_parameters('password', 'credit_card')\n\
|
||
\ def my_view(request):\n pw = request.POST['password']\n cc\
|
||
\ = request.POST['credit_card']\n ...\n\n* without any specified parameters,\
|
||
\ in which case consider all\n variables are sensitive:\n\n @sensitive_post_parameters()\n\
|
||
\ def my_view(request)\n ..."
|
||
source: allauth.account.views.sensitive_post_parameters
|
||
type: view_function
|
||
update_session_auth_hash:
|
||
description: 'Updating a user''s password logs out all sessions for the user.
|
||
|
||
|
||
Take the current request and the updated user object from which the new
|
||
|
||
session hash will be derived and update the session hash appropriately to
|
||
|
||
prevent a password change from logging out the session from which the
|
||
|
||
password was changed.'
|
||
source: django.contrib.auth.views.update_session_auth_hash
|
||
type: view_function
|
||
url_has_allowed_host_and_scheme:
|
||
description: 'Return ``True`` if the url uses an allowed host and a safe scheme.
|
||
|
||
|
||
Always return ``False`` on an empty url.
|
||
|
||
|
||
If ``require_https`` is ``True``, only ''https'' will be considered a valid
|
||
|
||
scheme, as opposed to ''http'' and ''https'' with the default, ``False``.
|
||
|
||
|
||
Note: "True" doesn''t entail that a URL is "safe". It may still be e.g.
|
||
|
||
quoted incorrectly. Ensure to also use django.utils.encoding.iri_to_uri()
|
||
|
||
on the path component of untrusted URLs.'
|
||
source: django.contrib.auth.views.url_has_allowed_host_and_scheme
|
||
type: view_function
|
||
urlsafe_base64_decode:
|
||
description: 'Decode a base64 encoded string. Add back any trailing equal signs
|
||
that
|
||
|
||
might have been stripped.'
|
||
source: appointment.views.urlsafe_base64_decode
|
||
type: view_function
|
||
urlunsplit:
|
||
description: 'Combine the elements of a tuple as returned by urlsplit() into a
|
||
|
||
complete URL as a string. The data argument can be any five-item iterable.
|
||
|
||
This may result in a slightly different, but equivalent URL, if the URL that
|
||
|
||
was parsed originally had unnecessary delimiters (for example, a ? with an
|
||
|
||
empty query; the RFC states that these are equivalent).'
|
||
source: django.contrib.auth.views.urlunsplit
|
||
type: view_function
|
||
shortcut:
|
||
description: Redirect to an object's page based on a content-type ID and an object
|
||
ID.
|
||
source: django.contrib.contenttypes.views.shortcut
|
||
type: view_function
|
||
serve:
|
||
description: "Serve static files below a given point in the directory structure\
|
||
\ or\nfrom locations inferred from the staticfiles finders.\n\nTo use, put a\
|
||
\ URL pattern such as::\n\n from django.contrib.staticfiles import views\n\
|
||
\n path('<path:path>', views.serve)\n\nin your URLconf.\n\nIt uses the django.views.static.serve()\
|
||
\ view to serve the found files."
|
||
source: django.contrib.staticfiles.views.serve
|
||
type: view_function
|
||
BillDeleteView:
|
||
description: 'Deletes a specific BillModel instance based on the primary key (pk).
|
||
|
||
This view requires the user to be logged in and have the appropriate
|
||
|
||
permission to delete a bill. After the delete operation is successful,
|
||
|
||
the user is redirected to the bill list view.
|
||
|
||
|
||
:param request: The HTTP request object.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param pk: Primary key of the BillModel instance to be deleted.
|
||
|
||
:type pk: int
|
||
|
||
:return: Redirect to the bill list view after successful deletion.
|
||
|
||
:rtype: HttpResponseRedirect'
|
||
source: inventory.views.BillDeleteView
|
||
type: view_function
|
||
CarTransferPreviewView:
|
||
description: "Handles the preview of car transfer details and ensures that a user\
|
||
\ has appropriate\npermissions to view the transfer based on their associated\
|
||
\ dealer.\n\nThis view checks if the car transfer's destination dealer matches\
|
||
\ the current user's\nassociated dealer type. If not, the user is redirected\
|
||
\ to the car detail page. Otherwise,\nit renders the transfer preview page with\
|
||
\ the relevant transfer details.\n\n:param request: The HTTP request object\n\
|
||
:type request: django.http.HttpRequest\n:param car_pk: The primary key of the\
|
||
\ car related to the transfer\n:type car_pk: int\n:param transfer_pk: The primary\
|
||
\ key of the car transfer to preview\n:type transfer_pk: int\n:return: An HTTP\
|
||
\ response rendering the transfer preview page or redirecting\n to the\
|
||
\ car detail page\n:rtype: django.http.HttpResponse"
|
||
source: inventory.views.CarTransferPreviewView
|
||
type: view_function
|
||
DealerSettingsView:
|
||
description: "Handles dealer settings view where dealers can update their financial\
|
||
\ and\npayment account settings. This view ensures validation and reassigns\
|
||
\ form\nfields dynamically based on the dealer's account roles.\n\n:param request:\
|
||
\ The HTTP request object received from the client. This parameter\n contains\
|
||
\ data including HTTP headers, session, and POST data if applicable.\n:type\
|
||
\ request: HttpRequest\n:param pk: Primary key representing the dealer for whom\
|
||
\ the settings are being\n retrieved or modified. This identifier is used\
|
||
\ to fetch or update dealer-\n specific settings from the database.\n:type\
|
||
\ pk: int\n:return: An HTTP response rendering the dealer settings form or redirecting\n\
|
||
\ to the dealer detail view after successful form submission.\n:rtype: HttpResponse"
|
||
source: inventory.views.DealerSettingsView
|
||
type: view_function
|
||
GroupDeleteview:
|
||
description: "Handles the deletion of a specific group instance. This view ensures\
|
||
\ that only\nauthenticated users can perform the deletion. Upon successful deletion,\
|
||
\ a\nsuccess message is displayed, and the user is redirected to the group list\
|
||
\ page.\n\n:param request: The HTTP request object that contains metadata about\
|
||
\ the\n request context and user information. Must be an authenticated user.\n\
|
||
:param pk: The primary key of the group instance to be deleted.\n It specifies\
|
||
\ which group to retrieve and delete.\n:return: The HTTP response that redirects\
|
||
\ the user to the group list page\n after the group is successfully deleted."
|
||
source: inventory.views.GroupDeleteview
|
||
type: view_function
|
||
GroupPermissionView:
|
||
description: "Handles the view for adding or modifying permissions of a specific\
|
||
\ group. This view\nfetches the group based on the primary key passed as a parameter,\
|
||
\ and either displays\na form for editing permissions or processes the submitted\
|
||
\ permissions.\n\nIf the request method is POST, the permissions of the group\
|
||
\ are cleared and updated\nbased on the submitted data. A success message is\
|
||
\ displayed upon completion, and\nthe user is redirected to the group's detail\
|
||
\ page.\n\nIn case of a GET request, the view renders the form pre-filled with\
|
||
\ the group's\ncurrent permissions.\n\n:param request: The HTTP request object.\n\
|
||
:type request: HttpRequest\n:param pk: The primary key of the group whose permissions\
|
||
\ are being modified.\n:type pk: int\n:return: The HTTP response depending on\
|
||
\ the request type. For GET requests, renders\n the permission form for the\
|
||
\ specified group. For POST requests, clears and updates\n the group's permissions\
|
||
\ and redirects to the group's detail page.\n:rtype: HttpResponse"
|
||
source: inventory.views.GroupPermissionView
|
||
type: view_function
|
||
JournalEntryDeleteView:
|
||
description: "Handles the deletion of a specific journal entry. This view facilitates\n\
|
||
the deletion of a journal entry identified by its primary key (pk). If the\n\
|
||
deletion is successful, the user is redirected to the list of journal entries\n\
|
||
for the associated ledger. If the deletion cannot proceed, an error message\n\
|
||
is displayed, and the user is redirected back to the journal entry list.\n\n\
|
||
:param request: The HTTP request object.\n:type request: HttpRequest\n:param\
|
||
\ pk: The primary key (pk) of the journal entry to be deleted.\n:type pk: int\n\
|
||
:return: A rendered HTML response for GET requests or a redirect upon\n \
|
||
\ successful/failed deletion.\n:rtype: HttpResponse"
|
||
source: inventory.views.JournalEntryDeleteView
|
||
type: view_function
|
||
JournalEntryTransactionsView:
|
||
description: "Handles the retrieval and display of journal entry transactions\
|
||
\ for a specific journal\nentry instance. It retrieves the journal entry and\
|
||
\ its associated transactions, ordering\nthe transactions by account code. The\
|
||
\ data is then rendered using the specified template.\n\n:param request: The\
|
||
\ HTTP request object.\n:type request: django.http.HttpRequest\n:param pk: The\
|
||
\ primary key of the journal entry to be retrieved.\n:type pk: int\n:return:\
|
||
\ An HTTP response with the rendered template, including the journal entry and\n\
|
||
\ its transactions.\n:rtype: django.http.HttpResponse"
|
||
source: inventory.views.JournalEntryTransactionsView
|
||
type: view_function
|
||
LeadDeleteView:
|
||
description: 'Handles the deletion of a Lead along with its associated customer
|
||
and potentially
|
||
|
||
a related user account in the system. Ensures proper permissions and login
|
||
|
||
are required before the operation is performed. Provides a success message
|
||
|
||
after the deletion is complete.
|
||
|
||
|
||
:param request: The HTTP request object specific to the current user.
|
||
|
||
:param pk: The primary key identifier of the Lead to be deleted.
|
||
|
||
:return: An HTTP redirect response to the lead list page.'
|
||
source: inventory.views.LeadDeleteView
|
||
type: view_function
|
||
OrganizationDeleteView:
|
||
description: 'Handles the deletion of an organization based on the provided primary
|
||
key (pk). Looks up
|
||
|
||
the organization and its corresponding user by email, attempts to delete both,
|
||
and provides
|
||
|
||
appropriate success or error feedback to the user. In case of failure, an error
|
||
message is shown,
|
||
|
||
while successful deletion redirects to the organization list.
|
||
|
||
|
||
:param request: The HTTP request object containing metadata about the request.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param pk: The primary key of the organization to be deleted.
|
||
|
||
:type pk: int
|
||
|
||
:return: An HTTP response redirecting to the organization list view.
|
||
|
||
:rtype: HttpResponseRedirect'
|
||
source: inventory.views.OrganizationDeleteView
|
||
type: view_function
|
||
PaymentCreateView:
|
||
description: "Handles the creation of a payment entry associated with an invoice\
|
||
\ or bill. Validates\nthe payment data against the model's current state and\
|
||
\ reflects the changes in\ninvoice or bill records. Provides appropriate error\
|
||
\ messages for invalid conditions\nsuch as exceeding payable amounts or attempting\
|
||
\ payment for already fully paid models.\n\nIf successfully processed, the payment\
|
||
\ details are saved, and the model is updated\naccordingly. This view regulates\
|
||
\ payment for dealer-associated entities while\nensuring the model consistency.\n\
|
||
\nThe view renders a form to submit payment details, and pre-populates the form\
|
||
\ fields\nwith default data for the associated model if necessary.\n\n:param\
|
||
\ request: The HTTP request object containing user request data and session\n\
|
||
\ information. This is required to handle the request and apply the appropriate\n\
|
||
\ processing rules.\n:param pk: The primary key of the invoice or bill being\
|
||
\ processed. It is used to\n load the appropriate model instance for payment\
|
||
\ processing.\n:return: An HTTP response object. Depending on the circumstances,\
|
||
\ the response may\n redirect to the detail view of the processed invoice\
|
||
\ or bill, re-render the\n payment form with error messages or indicate success\
|
||
\ in payment creation."
|
||
source: inventory.views.PaymentCreateView
|
||
type: view_function
|
||
PaymentDetailView:
|
||
description: "This function handles the detail view for a payment by fetching\
|
||
\ a journal entry\nand its associated transactions. It ensures that the request\
|
||
\ is authenticated\nand the user has permission to view the journal entry model.\n\
|
||
\n:param request: The HTTP request object.\n:type request: HttpRequest\n:param\
|
||
\ pk: The primary key of the journal entry for which details are to be fetched.\n\
|
||
:type pk: int\n:return: An HTTP response rendering the payment details template\
|
||
\ with the journal\n entry and its associated transactions.\n:rtype:\
|
||
\ HttpResponse"
|
||
source: inventory.views.PaymentDetailView
|
||
type: view_function
|
||
PaymentListView:
|
||
description: 'Handles the view for listing payment information associated with
|
||
the journals of a specific
|
||
|
||
entity. This view is protected to ensure only authenticated and authorized users
|
||
can
|
||
|
||
access it.
|
||
|
||
|
||
The function retrieves the related dealer object based on the current user session,
|
||
extracts
|
||
|
||
the associated entity, and fetches all journal entries linked to the entity.
|
||
This data is
|
||
|
||
then passed into the template for rendering.
|
||
|
||
|
||
:param request: The HTTP request object containing user context.
|
||
|
||
:type request: HttpRequest
|
||
|
||
|
||
:return: The rendered HTML response displaying the list of payments.
|
||
|
||
:rtype: HttpResponse'
|
||
source: inventory.views.PaymentListView
|
||
type: view_function
|
||
UserDeleteview:
|
||
description: 'Deletes a user and its associated staff member from the database
|
||
and redirects
|
||
|
||
to the user list page. Displays a success message upon successful deletion
|
||
|
||
of the user.
|
||
|
||
|
||
:param request: The HTTP request object representing the incoming request.
|
||
|
||
:param pk: The primary key (ID) of the staff member to be deleted.
|
||
|
||
:return: An HTTP redirect to the user list page.'
|
||
source: inventory.views.UserDeleteview
|
||
type: view_function
|
||
UserGroupView:
|
||
description: "Handles the assignment of user groups to a specific staff member.\
|
||
\ This view\nallows updating the groups a staff member belongs to via a form\
|
||
\ submission.\nIt processes both GET and POST requests, ensuring appropriate\
|
||
\ group\nassignments are managed and feedback is provided to the user via messages.\n\
|
||
\n:param request: HttpRequest object representing the HTTP request.\n:type request:\
|
||
\ HttpRequest\n:param pk: Primary key of the staff member whose groups are being\
|
||
\ updated.\n:type pk: int\n\n:return: Renders the user group form for GET requests\
|
||
\ or redirects to the\n user detail page after successful submission for\
|
||
\ POST requests.\n:rtype: HttpResponse or HttpResponseRedirect"
|
||
source: inventory.views.UserGroupView
|
||
type: view_function
|
||
account_delete:
|
||
description: 'Handles the deletion of an account object identified by its primary
|
||
key (pk). Ensures
|
||
|
||
that the user has the necessary permissions to perform the deletion. Successfully
|
||
|
||
deletes the account and redirects to the account list view with a success message.
|
||
|
||
|
||
:param request: The HTTP request object representing the current user and request
|
||
data.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param pk: The primary key of the account to be deleted.
|
||
|
||
:type pk: int
|
||
|
||
:return: An HTTP redirect response to the account list page.
|
||
|
||
:rtype: HttpResponse'
|
||
source: inventory.views.account_delete
|
||
type: view_function
|
||
accruable_net_summary:
|
||
description: 'A convenience function that computes current net summary of accruable
|
||
models.
|
||
|
||
"net_30" group indicates the total amount is due in 30 days or less.
|
||
|
||
"net_0" group indicates total past due amount.
|
||
|
||
|
||
:param queryset: Accruable Objects Queryset.
|
||
|
||
:return: A dictionary summarizing current net summary 0,30,60,90,90+ bill open
|
||
amounts.'
|
||
source: django_ledger.views.accruable_net_summary
|
||
type: view_function
|
||
add_activity_to_customer:
|
||
description: "Adds an activity to a specific customer.\n\nThis function allows\
|
||
\ adding a new activity to a customer identified by their\nprimary key (`pk`).\
|
||
\ It retrieves the customer object, processes the form for\nactivity creation,\
|
||
\ and saves it. If the request method is POST, it validates\nthe form and associates\
|
||
\ the activity with the respective customer. Upon\nsuccessful save, it redirects\
|
||
\ to the customer detail view. If the request\nmethod is GET, it renders a form\
|
||
\ for activity submission.\n\n:param request: The HTTP request object containing\
|
||
\ metadata about the request.\n:type request: HttpRequest\n:param pk: The primary\
|
||
\ key of the customer to which the activity will be added.\n:type pk: int\n\
|
||
:return: An HTTP response rendered with the activity form in the context of\n\
|
||
\ the customer, or a redirect response to the customer detail view upon\n\
|
||
\ successful activity creation.\n:rtype: HttpResponse"
|
||
source: inventory.views.add_activity_to_customer
|
||
type: view_function
|
||
add_activity_to_lead:
|
||
description: 'Handles the process of adding a new activity to a specific lead.
|
||
This includes
|
||
|
||
rendering a form for user input, validating the form submission, and saving
|
||
the
|
||
|
||
new activity if the input is valid. If the method is GET, it will simply
|
||
|
||
render the form. If the method is POST, it checks the form validity, creates
|
||
|
||
the activity, associates it with the lead, and saves it to the database.
|
||
|
||
|
||
:param request: The HTTP request object containing metadata about the request
|
||
made
|
||
|
||
:param pk: The primary key of the lead to which the activity is to be added
|
||
|
||
:return: An HTTP response that either renders the form or redirects to the lead
|
||
detail page'
|
||
source: inventory.views.add_activity_to_lead
|
||
type: view_function
|
||
add_note_to_customer:
|
||
description: "This function allows authenticated users to add a note to a specific\
|
||
\ customer. The\nnote creation is handled by a form, which is validated after\
|
||
\ submission. If the form\nis valid, the note is saved and associated with the\
|
||
\ specified customer. On successful\nsubmission, the user is redirected to the\
|
||
\ customer detail page. If the request method\nis not POST, an empty form is\
|
||
\ rendered.\n\n:param request: The HTTP request object containing metadata and\
|
||
\ the method type\n (e.g., GET, POST). Should be an HttpRequest\
|
||
\ instance.\n:param customer_id: The unique identifier (UUID) of the customer\
|
||
\ to whom the note\n is to be added.\n:return: An HTTP response.\
|
||
\ In the case of a successful POST request, the function\n returns a\
|
||
\ redirect response to the customer detail page. For a GET or invalid\n \
|
||
\ POST request, it renders the note form template with context including\n\
|
||
\ the form and customer."
|
||
source: inventory.views.add_note_to_customer
|
||
type: view_function
|
||
add_note_to_lead:
|
||
description: "Adds a note to a specific lead. This view is accessible only to\
|
||
\ authenticated\nusers. The function handles the POST request to create a new\
|
||
\ note associated\nwith a lead. Upon successful submission, the note is linked\
|
||
\ to the provided lead,\nand the user is redirected to the lead's detail page.\
|
||
\ If the request method is\nnot POST, it initializes an empty form to add a\
|
||
\ note.\n\n:param request: The HTTP request object\n:type request: HttpRequest\n\
|
||
:param pk: The primary key of the lead to which the note will be added\n:type\
|
||
\ pk: int\n:return: HTTP response object. Redirects to the lead detail page\
|
||
\ on successful\n note creation or renders the note form template for GET\
|
||
\ or invalid POST requests.\n:rtype: HttpResponse"
|
||
source: inventory.views.add_note_to_lead
|
||
type: view_function
|
||
add_note_to_opportunity:
|
||
description: 'Add a note to a specific opportunity identified by its primary key.
|
||
|
||
|
||
This function handles the addition of a note to an existing opportunity
|
||
|
||
by processing a POST request that includes the note content. If the note
|
||
|
||
content is missing, an error message will be displayed. If the operation
|
||
|
||
is successful, the note is saved, and a success message is returned.
|
||
|
||
|
||
:param request: The HTTP request object representing the client''s request.
|
||
|
||
:param pk: The primary key of the Opportunity to which the note is to be added.
|
||
|
||
:type pk: int
|
||
|
||
:return: A redirect response to the detailed view of the opportunity.'
|
||
source: inventory.views.add_note_to_opportunity
|
||
type: view_function
|
||
apply_search_filters:
|
||
description: "Apply search filters to a queryset based on a query string.\n\n\
|
||
This function filters the provided queryset by applying a Q object for all\n\
|
||
CharField, TextField, or EmailField fields in the model. It checks if the\n\
|
||
query exists within these fields using case-insensitive containment (icontains).\n\
|
||
If the query string is empty or None, the original queryset is returned\nwithout\
|
||
\ any modifications.\n\n:param queryset: The initial queryset to apply the search\
|
||
\ filters on.\n:param query: The search string to match against the model fields.\
|
||
\ If None\n or an empty string, no filtering is applied.\n:return: A filtered\
|
||
\ queryset that satisfies the search condition."
|
||
source: inventory.views.apply_search_filters
|
||
type: view_function
|
||
assign_car_makes:
|
||
description: "Assigns car makes to a dealer.\n\nThis function handles both the\
|
||
\ display and processing of a form that allows\na dealer to assign or modify\
|
||
\ their associated car makes. If the request\nmethod is POST, it validates and\
|
||
\ saves the submitted form data. If the\nmethod is not POST, it displays a form\
|
||
\ prefilled with the existing car makes\nassociated with the dealer.\n\n:param\
|
||
\ request: The HTTP request object containing information about the\n current\
|
||
\ request.\n:type request: HttpRequest\n:return: A rendered HTML response for\
|
||
\ GET requests, or a redirect to the\n dealer detail page after successful\
|
||
\ form submission.\n:rtype: HttpResponse"
|
||
source: inventory.views.assign_car_makes
|
||
type: view_function
|
||
bank_account_delete:
|
||
description: "Delete a bank account entry from the database.\n\nThis view handles\
|
||
\ the deletion of a bank account record specified by its\nprimary key (pk).\
|
||
\ It renders a deletion confirmation page and processes the\ndeletion if the\
|
||
\ request method is POST. Upon successful deletion, the user is\nredirected\
|
||
\ to the list of bank accounts and a success message is displayed.\n\n:param\
|
||
\ request: The HTTP request object representing the client's request.\n It\
|
||
\ contains data such as request type (GET or POST) and session\n information.\n\
|
||
:type request: HttpRequest\n:param pk: The primary key of the bank account model\
|
||
\ instance to be deleted.\n:type pk: int\n:return: Returns an HttpResponse object.\
|
||
\ This can be an HTTP redirect to the\n bank account list page upon successful\
|
||
\ deletion, or an HTML response\n rendering the confirmation template if\
|
||
\ accessed via GET.\n:rtype: HttpResponse"
|
||
source: inventory.views.bank_account_delete
|
||
type: view_function
|
||
bill_create:
|
||
description: "Handles creation of a bill in the system, including the validation\
|
||
\ of input data,\ncreation of transactions associated with the bill, and rendering\
|
||
\ of the appropriate\nresponse or form. Ensures the user creating the bill has\
|
||
\ the necessary permissions and\ncorrect input parameters for successful bill\
|
||
\ creation and itemization.\n\n:param request: Django HttpRequest object containing\
|
||
\ metadata and data of the HTTP request.\n:type request: HttpRequest\n:return:\
|
||
\ JsonResponse with success/error information if the request is processed,\n\
|
||
\ or HttpResponse rendering the form for bill creation.\n:rtype: JsonResponse\
|
||
\ or HttpResponse"
|
||
source: inventory.views.bill_create
|
||
type: view_function
|
||
bill_mark_as_approved:
|
||
description: "Marks a bill as approved for the given bill ID (primary key) if\
|
||
\ it is not\nalready approved. This action can only be completed by an authorized\
|
||
\ user\nwith the corresponding permissions. Once the bill is approved, it is\
|
||
\ saved\nand a success message is displayed. If the bill is already approved,\
|
||
\ an\nerror message is shown instead.\n\n:param request: HttpRequest object\
|
||
\ representing the current request.\n:param pk: Primary key of the bill to be\
|
||
\ marked as approved.\n:return: HttpResponseRedirect to the bill detail page\
|
||
\ after the operation is\n completed or an error/success message is\
|
||
\ set."
|
||
source: inventory.views.bill_mark_as_approved
|
||
type: view_function
|
||
bill_mark_as_paid:
|
||
description: 'Marks a bill as paid if certain conditions are met and updates the
|
||
ledger accordingly.
|
||
|
||
|
||
This function is used to mark a specific bill as paid. It verifies whether the
|
||
bill
|
||
|
||
is already paid or if the amount paid matches the amount due. If the conditions
|
||
are
|
||
|
||
met, it updates the bill''s status, locks the journal entries in the associated
|
||
ledger,
|
||
|
||
posts them, and saves the changes. Appropriate success or error messages are
|
||
displayed
|
||
|
||
to the user, and the user is redirected to the bill details page.
|
||
|
||
|
||
:param request: The HTTP request object containing details about the request
|
||
made by the user.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param pk: The primary key of the bill to be marked as paid.
|
||
|
||
:type pk: int
|
||
|
||
:return: A redirect response to the bill details page.
|
||
|
||
:rtype: HttpResponseRedirect'
|
||
source: inventory.views.bill_mark_as_paid
|
||
type: view_function
|
||
car_history:
|
||
description: "Fetch and display the history of activities related to a specific\
|
||
\ car.\n\nThis view retrieves a car object based on its primary key (pk) and\
|
||
\ gathers\nall related activity records where the content type corresponds to\
|
||
\ the car\nmodel. The retrieved data is then rendered into a specified HTML\
|
||
\ template\nfor presentation.\n\n:param request: The HTTP request object that\
|
||
\ contains metadata about the\n request made by the client.\n:type request:\
|
||
\ HttpRequest\n:param pk: The primary key of the car object to retrieve.\n:type\
|
||
\ pk: int\n:return: An HTTP response with the rendered car history HTML template,\n\
|
||
\ including the car and its associated activities as context data.\n:rtype:\
|
||
\ HttpResponse"
|
||
source: inventory.views.car_history
|
||
type: view_function
|
||
car_transfer_accept_reject:
|
||
description: "Handles the acceptance or rejection of a car transfer request. Based\
|
||
\ on the\n`status` parameter obtained from the query string, the function updates\
|
||
\ the\ntransfer status to either 'accept' or 'reject'. If the transfer is accepted,\
|
||
\ it\ninitiates the car transfer process. Appropriate notifications are sent,\
|
||
\ and\nactivity records are created for both acceptance and rejection actions.\n\
|
||
\n:param request: The HTTP request object which contains metadata about\n \
|
||
\ the request made by the user, including session and user information.\n:param\
|
||
\ car_pk: The primary key of the car to be transferred.\n:param transfer_pk:\
|
||
\ The primary key of the car transfer request to be processed.\n:return: An\
|
||
\ HTTP redirect response to the 'inventory_stats' view."
|
||
source: inventory.views.car_transfer_accept_reject
|
||
type: view_function
|
||
car_transfer_approve:
|
||
description: 'Approves or cancels a car transfer request based on the action parameter.
|
||
This view
|
||
|
||
handles the workflow of updating the transfer status and notifying the involved
|
||
parties
|
||
|
||
accordingly. If the transfer is canceled, it reverts the car status to "available"
|
||
and
|
||
|
||
deactivates the transfer record. If approved, it notifies the recipient dealer
|
||
and allows
|
||
|
||
the request to proceed for further actions.
|
||
|
||
|
||
:param request: The HTTP request object containing metadata and the action parameter.
|
||
|
||
:param car_pk: Primary key of the car involved in the transfer.
|
||
|
||
:param transfer_pk: Primary key of the transfer request to approve or cancel.
|
||
|
||
:return: An HTTP response redirecting to the car detail page of the specified
|
||
car.'
|
||
source: inventory.views.car_transfer_approve
|
||
type: view_function
|
||
create_estimate:
|
||
description: "Creates a new estimate based on the provided data and saves it.\
|
||
\ This function processes\na POST request and expects a JSON payload containing\
|
||
\ details of the estimate such as\ntitle, customer, terms, items, and quantities.\
|
||
\ It validates the input data, ensures\navailability of stocks, and updates\
|
||
\ or creates the corresponding estimate in the database.\n\nIf `pk` is provided,\
|
||
\ it links the created estimate with an existing opportunity. It handles\nthe\
|
||
\ reservation of cars and updates the stock information accordingly.\n\n:param\
|
||
\ request: The HttpRequest object containing user-specific data and state.\n\
|
||
:type request: HttpRequest\n:param pk: An optional primary key of the existing\
|
||
\ opportunity to associate with\n the created estimate.\n:type pk:\
|
||
\ int, optional\n:return: A JsonResponse object with status and either the created\
|
||
\ quotation URL\n or an error message. If the request method is not\
|
||
\ POST, it renders the\n estimate creation form.\n:rtype: JsonResponse\
|
||
\ or HttpResponse"
|
||
source: inventory.views.create_estimate
|
||
type: view_function
|
||
create_sale_order:
|
||
description: "Creates a sale order for a given estimate and updates associated\
|
||
\ item and car data.\n\nThis view is responsible for handling the submission\
|
||
\ of a sale order form linked to\na specific estimate. It ensures that the estimate\
|
||
\ is approved if not already, updates\nthe status of the related car items as\
|
||
\ sold, and redirects to the estimate's detailed\nview upon successful creation\
|
||
\ of the sale order. If the request method is not POST, it\nrenders the form\
|
||
\ for the user to input sale order details, along with other contextual\ninformation\
|
||
\ like estimate data and car finance details.\n\n:param request: HTTP request\
|
||
\ object.\n:type request: HttpRequest\n:param pk: Primary key of the estimate\
|
||
\ to create a sale order for.\n:type pk: int\n:return: An HTTP response rendering\
|
||
\ the sale order form if the method is GET or invalid\n POST data, or redirects\
|
||
\ to the estimate detail view upon successful creation.\n:rtype: HttpResponse"
|
||
source: inventory.views.create_sale_order
|
||
type: view_function
|
||
csrf_exempt:
|
||
description: Mark a view function as being exempt from the CSRF view protection.
|
||
source: rest_framework.views.csrf_exempt
|
||
type: view_function
|
||
custom_bad_request_view:
|
||
description: 'Handles custom bad request responses by rendering a specified HTML
|
||
|
||
template for 400 status errors.
|
||
|
||
|
||
:return: Rendered HTTP response rendering the error page.
|
||
|
||
:rtype: HttpResponse'
|
||
source: inventory.views.custom_bad_request_view
|
||
type: view_function
|
||
custom_error_view:
|
||
description: 'Handles rendering the custom error page for HTTP 500 errors.
|
||
|
||
|
||
This function is called when an unhandled exception occurs in the application.
|
||
It renders
|
||
|
||
a predefined template for server errors, providing a consistent error page layout
|
||
|
||
to the users.
|
||
|
||
|
||
:param request: The HTTP request instance which triggered the error.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param exception: The exception that caused the error to trigger. Defaults to
|
||
None.
|
||
|
||
:type exception: Exception, optional
|
||
|
||
:return: An HttpResponse object representing the rendered error page.
|
||
|
||
:rtype: HttpResponse'
|
||
source: inventory.views.custom_error_view
|
||
type: view_function
|
||
custom_page_not_found_view:
|
||
description: 'Custom handler for 404 errors that renders a custom HTML page
|
||
|
||
upon encountering a Page Not Found error.
|
||
|
||
|
||
:param request: The HttpRequest object associated with the request.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param exception: The exception that triggered the 404 error, if any.
|
||
|
||
:type exception: Exception, optional
|
||
|
||
:return: An HttpResponse object rendering the "errors/404.html" template.
|
||
|
||
:rtype: HttpResponse'
|
||
source: inventory.views.custom_page_not_found_view
|
||
type: view_function
|
||
custom_permission_denied_view:
|
||
description: "Handles the custom view for 403 Forbidden permission denied errors.\
|
||
\ This\nfunction renders a custom template for the error page when users are\
|
||
\ denied\npermission to access a particular resource or view.\n\n:param request:\
|
||
\ Django HttpRequest object containing metadata about the request.\n:type request:\
|
||
\ HttpRequest\n:param exception: Optional exception that caused the 403 error.\n\
|
||
\ Defaults to None.\n:type exception: Exception | None\n:return:\
|
||
\ HttpResponse object rendering the 403.html error page.\n:rtype: HttpResponse"
|
||
source: inventory.views.custom_permission_denied_view
|
||
type: view_function
|
||
dealer_signup:
|
||
description: "Handles the dealer signup wizard process, including forms validation,\
|
||
\ user and group\ncreation, permissions assignment, and dealer data storage.\
|
||
\ This view supports GET\nrequests for rendering the signup wizard page, and\
|
||
\ POST requests for processing\nsubmitted data. The function also differentiates\
|
||
\ between requests sent with the\n\"Hx-Request\" header for partial form validations\
|
||
\ in the wizard.\n\n:param request: The HTTP request object representing the\
|
||
\ client request. It contains\n metadata about the request and the POST data\
|
||
\ for creating the dealer.\n:type request: django.http.HttpRequest\n:param args:\
|
||
\ Optional positional arguments passed to the view during the call.\n:type args:\
|
||
\ tuple\n:param kwargs: Optional keyword arguments passed to the view during\
|
||
\ the call.\n:type kwargs: dict\n:return: A rendered signup wizard page or a\
|
||
\ JSON response indicating operation success\n or failure.\n:rtype: Union[django.http.HttpResponse,\
|
||
\ django.http.JsonResponse]"
|
||
source: inventory.views.dealer_signup
|
||
type: view_function
|
||
decode:
|
||
description: "Decodes datamatrix barcodes in `image`.\n\nArgs:\n image: `numpy.ndarray`,\
|
||
\ `PIL.Image` or tuple (pixels, width, height)\n symbols: iter(ZBarSymbol)\
|
||
\ the symbol types to decode; if `None`, uses\n `zbar`'s default behaviour,\
|
||
\ which is to decode all symbol types.\n\nReturns:\n :obj:`list` of :obj:`Decoded`:\
|
||
\ The values decoded from barcodes."
|
||
source: inventory.views.decode
|
||
type: view_function
|
||
decodevin:
|
||
description: "Decodes a Vehicle Identification Number (VIN) using multiple decoding\
|
||
\ functions\nand returns the decoded result. This function attempts to decode\
|
||
\ the VIN using\nthree different functions in sequence and returns the first\
|
||
\ successful result.\nIf none of the decoding functions produce a valid result,\
|
||
\ the function returns None.\n\n:param vin: The Vehicle Identification Number\
|
||
\ (VIN) to be decoded.\n:type vin: str\n:return: The decoded result if any decoding\
|
||
\ function is successful, or None if\n all decoding attempts fail.\n\
|
||
:rtype: dict | None"
|
||
source: api.views.decodevin
|
||
type: view_function
|
||
delete_customer:
|
||
description: 'Deletes a customer from the system and deactivates the corresponding
|
||
user account.
|
||
|
||
|
||
This function retrieves a customer object based on the primary key (pk),
|
||
|
||
sets their active status to False, and deactivates the linked user account
|
||
|
||
(using the email associated with the customer). After saving these changes,
|
||
|
||
it displays a success message to the user and redirects to the customer list
|
||
page.
|
||
|
||
|
||
:param request: A HttpRequest object containing metadata about the request.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param pk: Primary key of the customer to be deleted.
|
||
|
||
:type pk: int
|
||
|
||
:return: A redirect response to the customer list page.
|
||
|
||
:rtype: HttpResponseRedirect'
|
||
source: inventory.views.delete_customer
|
||
type: view_function
|
||
delete_note:
|
||
description: 'Deletes a specific note created by the currently logged-in user
|
||
and redirects
|
||
|
||
to the lead detail page. If the note does not exist or the user is not the creator,
|
||
|
||
a 404 error will be raised. A success message is displayed upon successful deletion
|
||
|
||
of the note.
|
||
|
||
|
||
:param request: The HTTP request object associated with the current request.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param pk: The primary key of the note to be deleted.
|
||
|
||
:type pk: int
|
||
|
||
:return: An HTTP redirection to the lead detail page of the corresponding note''s
|
||
lead.
|
||
|
||
:rtype: HttpResponseRedirect'
|
||
source: inventory.views.delete_note
|
||
type: view_function
|
||
delete_opportunity:
|
||
description: 'Deletes an opportunity object from the database and redirects to
|
||
the opportunity
|
||
|
||
list view. If the opportunity with the specified primary key is not found, a
|
||
404
|
||
|
||
error will be raised. Displays a success message after deletion.
|
||
|
||
|
||
:param request: The HTTP request object containing metadata about the request.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param pk: The primary key of the opportunity object to be deleted.
|
||
|
||
:type pk: int
|
||
|
||
:return: An HTTP response redirecting to the opportunity list view.
|
||
|
||
:rtype: HttpResponse'
|
||
source: inventory.views.delete_opportunity
|
||
type: view_function
|
||
delete_vendor:
|
||
description: 'Deletes an existing vendor record from the database.
|
||
|
||
|
||
This function allows users with valid authentication to delete a specified
|
||
|
||
vendor object by its primary key. Upon successful deletion, a success message
|
||
|
||
is displayed, and the user is redirected to the vendor list page.
|
||
|
||
|
||
:param request: HttpRequest object containing metadata about the request.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param pk: Primary key of the vendor object to be deleted.
|
||
|
||
:type pk: int
|
||
|
||
:return: HttpResponseRedirect object for redirecting to the vendor list page.
|
||
|
||
:rtype: HttpResponseRedirect'
|
||
source: inventory.views.delete_vendor
|
||
type: view_function
|
||
estimate_mark_as:
|
||
description: 'Marks an estimate with a specified status based on the requested
|
||
action and
|
||
|
||
permissions. The marking possibilities include review, approval, rejection,
|
||
|
||
completion, and cancellation. The function validates whether the estimate
|
||
|
||
can transition to the desired status before updating it. It also handles
|
||
|
||
notifications and updates related entities if required, such as car status
|
||
|
||
changes upon cancellation.
|
||
|
||
|
||
:param request: The HTTP request object containing metadata about the request.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param pk: The primary key of the estimate to be marked.
|
||
|
||
:type pk: int
|
||
|
||
:return: A redirect response to the estimate detail view.
|
||
|
||
:rtype: HttpResponseRedirect'
|
||
source: inventory.views.estimate_mark_as
|
||
type: view_function
|
||
get_car_finance_data:
|
||
description: "Fetches car finance data from the provided model instance and calculates\n\
|
||
various related details including total prices, VAT, discounts, and\nadditional\
|
||
\ services information.\n\n:param model: The model instance that contains car\
|
||
\ and finance-related\n transaction data.\n:type model: Model\n:return: A\
|
||
\ dictionary containing detailed information about the car finance\n transactions,\
|
||
\ including individual car details, total quantity, calculated\n totals for\
|
||
\ prices, VAT, discounts, additional services, and the VAT rate.\n:rtype: dict"
|
||
source: inventory.views.get_car_finance_data
|
||
type: view_function
|
||
get_item_transactions:
|
||
description: 'Extracts and compiles relevant transaction details from a list of
|
||
transactions,
|
||
|
||
including information about cars, financing, estimates, and invoices. The extracted
|
||
|
||
details for each transaction are stored as dictionaries in a list.
|
||
|
||
|
||
:param txs: A list of transaction objects from which information is extracted.
|
||
|
||
:type txs: list
|
||
|
||
:return: A list of dictionaries, each containing extracted transaction details.
|
||
|
||
:rtype: list'
|
||
source: inventory.views.get_item_transactions
|
||
type: view_function
|
||
get_localdate:
|
||
description: "Fetches the current local date, optionally considering time zone\
|
||
\ settings.\n\nThis function retrieves the current local date. If the global\
|
||
\ settings indicate\nthe use of time zones (`USE_TZ` is True), the date is determined\
|
||
\ based on the\nlocal time zone. Otherwise, the date is based on the system's\
|
||
\ local time without\nany time zone consideration.\n\nReturns\n-------\ndate\n\
|
||
\ The current local date, adjusted for the time zone setting if applicable."
|
||
source: django_ledger.views.get_localdate
|
||
type: view_function
|
||
get_make:
|
||
description: 'Fetches a car make object from the database based on the provided
|
||
item. The function
|
||
|
||
first attempts an exact case-insensitive match on the full string. If no match
|
||
is found,
|
||
|
||
it splits the input string by spaces and checks for a match with each fragment,
|
||
stopping
|
||
|
||
as soon as a match is found.
|
||
|
||
|
||
:param item: A string representing the name or a part of the name of the car
|
||
make to search.
|
||
|
||
:type item: str
|
||
|
||
:return: The first matching CarMake object found, or None if no match is found.
|
||
|
||
:rtype: CarMake or None'
|
||
source: inventory.views.get_make
|
||
type: view_function
|
||
get_model:
|
||
description: "Searches for a car model associated with a specific make by performing\
|
||
\ an\nexact case-insensitive match. If no match is found, it attempts to match\n\
|
||
based on individual words split from the input item.\n\n:param item: A string\
|
||
\ representing the name of the car model to search for.\n:param make: An object\
|
||
\ representing the car manufacturer, which contains the\n associated car\
|
||
\ models.\n:return: Returns the first car model object that matches the search\
|
||
\ criteria,\n or None if no match is found."
|
||
source: inventory.views.get_model
|
||
type: view_function
|
||
get_object_or_404:
|
||
description: 'Use get() to return an object, or raise an Http404 exception if
|
||
the object
|
||
|
||
does not exist.
|
||
|
||
|
||
klass may be a Model, Manager, or QuerySet object. All other passed
|
||
|
||
arguments and keyword arguments are used in the get() query.
|
||
|
||
|
||
Like with QuerySet.get(), MultipleObjectsReturned is raised if more than
|
||
|
||
one object is found.'
|
||
source: plans.views.get_object_or_404
|
||
type: view_function
|
||
get_user_type:
|
||
description: "Determine the type of user based on the given request object.\n\n\
|
||
This function identifies the type of user from the provided request. It\nchecks\
|
||
\ if the user is a dealer, staff member, or neither based on the\nattributes\
|
||
\ of the request object, returning the appropriate associated\nuser type or\
|
||
\ `None` if the determination cannot be made.\n\n:param request: The HTTP request\
|
||
\ object containing user and role\n information.\n:type request: Any\n:return:\
|
||
\ A dealer object if the user is a dealer, a dealer object\n associated with\
|
||
\ the staff member if the user is a staff member, or\n None if the user type\
|
||
\ cannot be identified.\n:rtype: Optional[Any]"
|
||
source: api.views.get_user_type
|
||
type: view_function
|
||
inventory_stats_view:
|
||
description: "Handle the inventory stats view for a dealer, displaying detailed\
|
||
\ information\nabout the cars, including counts grouped by make, model, and\
|
||
\ trim.\n\nThe function fetches all cars associated with the authenticated dealer,\
|
||
\ calculates\nthe inventory statistics (e.g., total cars, reserved cars, and\
|
||
\ cars categorized\nby make, model, and trim levels), and prepares the data\
|
||
\ to be rendered in a\ntemplate.\n\n:param request: The HTTP request object\
|
||
\ from the client.\n:type request: HttpRequest\n:return: An HTTP response containing\
|
||
\ structured inventory data rendered in the\n \"inventory/inventory_stats.html\"\
|
||
\ template.\n:rtype: HttpResponse"
|
||
source: inventory.views.inventory_stats_view
|
||
type: view_function
|
||
invoice_create:
|
||
description: "Handles the creation of a new invoice associated with a given estimate.\
|
||
\ It validates\nthe submitted data through a form, processes the invoice, updates\
|
||
\ related models, and\nfinalizes the estimate. If successful, redirects to the\
|
||
\ detailed view of the created\ninvoice. If the submitted data is invalid or\
|
||
\ the request is not a POST request, renders\nthe invoice creation form.\n\n\
|
||
:param request: The HTTP request object.\n:type request: HttpRequest\n:param\
|
||
\ pk: The primary key of the estimate associated with the invoice.\n:type pk:\
|
||
\ int\n:return: An HTTP response. Redirects to the \"invoice_detail\" view upon\
|
||
\ successful invoice\n creation or renders the invoice creation form template\
|
||
\ otherwise.\n:rtype: HttpResponse"
|
||
source: inventory.views.invoice_create
|
||
type: view_function
|
||
invoice_mark_as:
|
||
description: 'Marks an invoice as approved if it meets the required conditions.
|
||
|
||
|
||
This view is responsible for marking an invoice as approved based on the provided
|
||
|
||
`mark` parameter. If the `mark` parameter is specified as "accept" and the invoice
|
||
|
||
is eligible for approval, it gets approved and saved. Otherwise, an error message
|
||
|
||
is displayed. The function requires the user to be logged in and to have the
|
||
|
||
appropriate permission to change the InvoiceModel.
|
||
|
||
|
||
:param request: The HTTP request object containing metadata about the request.
|
||
|
||
:type request: django.http.HttpRequest
|
||
|
||
:param pk: The primary key of the invoice to be processed.
|
||
|
||
:type pk: int
|
||
|
||
:return: An HTTP redirect response to the invoice detail page after processing.
|
||
|
||
:rtype: django.http.HttpResponse'
|
||
source: inventory.views.invoice_mark_as
|
||
type: view_function
|
||
lead_convert:
|
||
description: 'Converts a lead into a customer and creates a corresponding opportunity.
|
||
|
||
|
||
The function ensures that leads are not converted to customers more than once.
|
||
|
||
If the lead has already been converted, an error is displayed. Otherwise,
|
||
|
||
the lead is converted into a customer and a new opportunity is created.
|
||
|
||
Upon successful conversion, the user is redirected to the lead list view
|
||
|
||
and a success message is displayed.
|
||
|
||
|
||
:param request: The HTTP request object representing the user''s request.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param pk: The primary key of the lead to be converted.
|
||
|
||
:type pk: int
|
||
|
||
:return: An HTTP response redirecting to the lead list view.
|
||
|
||
:rtype: HttpResponse'
|
||
source: inventory.views.lead_convert
|
||
type: view_function
|
||
lead_create:
|
||
description: 'Handles the creation of a new lead in the inventory system.
|
||
|
||
|
||
This function manages the rendering and processing of a form for creating a
|
||
new
|
||
|
||
lead. It filters options for car models in the form based on the selected car
|
||
|
||
make. For POST requests, it validates and processes the submitted form data
|
||
|
||
and creates the lead if valid. It also creates a corresponding customer in the
|
||
|
||
ledger system if one does not exist for the provided email.
|
||
|
||
|
||
:param request: The HTTP request object containing request data.
|
||
|
||
:type request: HttpRequest
|
||
|
||
|
||
:return: An HTTP response object rendering the lead creation form or redirecting
|
||
to the lead list page upon success.
|
||
|
||
:rtype: HttpResponse'
|
||
source: inventory.views.lead_create
|
||
type: view_function
|
||
lead_transfer:
|
||
description: 'Handles the transfer of a lead to a different staff member. This
|
||
view is accessible
|
||
|
||
only to authenticated users with the ''inventory.change_lead'' permission. If
|
||
the
|
||
|
||
request method is POST and the form data is valid, the lead''s staff is updated
|
||
|
||
accordingly, saved, and a success message is displayed. Otherwise, an error
|
||
message
|
||
|
||
is shown. In both cases, the user is redirected to the lead listing page.
|
||
|
||
|
||
:param request: The HTTP request object.
|
||
|
||
:param pk: The primary key of the lead to be transferred.
|
||
|
||
:return: An HTTP redirect response to the lead list view.'
|
||
source: inventory.views.lead_transfer
|
||
type: view_function
|
||
ledger_lock_all_journals:
|
||
description: 'Locks all journals associated with a specific ledger. If the ledger
|
||
is already locked,
|
||
|
||
it will notify the user through an error message. Otherwise, it initiates the
|
||
locking of
|
||
|
||
related journal entries, locks the ledger itself, and saves the changes to the
|
||
database.
|
||
|
||
After the operation, it redirects the user to the journal entry list associated
|
||
with the
|
||
|
||
ledger.
|
||
|
||
|
||
:param request: HttpRequest object representing the current request.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param entity_slug: The slug identifier of the entity.
|
||
|
||
:type entity_slug: str
|
||
|
||
:param pk: The primary key of the ledger to be locked.
|
||
|
||
:type pk: int
|
||
|
||
:return: HttpResponse redirecting to the journal entry list page of the locked
|
||
ledger.
|
||
|
||
:rtype: HttpResponse'
|
||
source: inventory.views.ledger_lock_all_journals
|
||
type: view_function
|
||
ledger_post_all_journals:
|
||
description: 'Posts all journal entries associated with a ledger. This function
|
||
updates the ledger''s
|
||
|
||
state to reflect that its journal entries have been posted. If the ledger is
|
||
already
|
||
|
||
posted, an error message is displayed and the user is redirected.
|
||
|
||
|
||
:param request: The HTTP request object used for processing the action.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param entity_slug: A string representing the specific entity slug for the ledger
|
||
context.
|
||
|
||
:type entity_slug: str
|
||
|
||
:param pk: The primary key of the ledger to be posted.
|
||
|
||
:type pk: int
|
||
|
||
:return: A redirect to the journal entry list view for the specified ledger.
|
||
|
||
:rtype: HttpResponseRedirect'
|
||
source: inventory.views.ledger_post_all_journals
|
||
type: view_function
|
||
ledger_unlock_all_journals:
|
||
description: 'Unlocks all journal entries associated with a specific ledger. This
|
||
function first checks if the
|
||
|
||
ledger is locked. If it is already unlocked, it shows an error message and redirects
|
||
the user
|
||
|
||
to the journal entry list page. If the ledger is locked, it unlocks the ledger,
|
||
saves changes,
|
||
|
||
and iterates through all the locked journal entries within the ledger to unlock
|
||
them as well.
|
||
|
||
Afterward, it redirects the user to the journal entry list page.
|
||
|
||
|
||
:param request: The HTTP request object containing user session and request
|
||
metadata.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param entity_slug: A unique string slug representing the specific entity or
|
||
organization context.
|
||
|
||
:type entity_slug: str
|
||
|
||
:param pk: The primary key of the ledger record to be unlocked.
|
||
|
||
:type pk: int
|
||
|
||
:return: A redirection to the journal entry list page for the specified ledger.
|
||
|
||
:rtype: HttpResponseRedirect'
|
||
source: inventory.views.ledger_unlock_all_journals
|
||
type: view_function
|
||
ledger_unpost_all_journals:
|
||
description: "Unposts all journal entries for a specified ledger and marks the\
|
||
\ ledger as unposted.\n\nThis function identifies a ledger by its primary key\
|
||
\ (pk) and checks if it is\nalready posted. If the ledger is not posted, an\
|
||
\ error message is displayed.\nIf it is posted, the function iterates through\
|
||
\ its posted journal entries,\nmarks them as unposted, and saves the changes.\
|
||
\ Finally, it marks the ledger itself\nas unposted and saves it.\n\n:param request:\
|
||
\ The HTTP request object from the client.\n:type request: HttpRequest\n:param\
|
||
\ entity_slug: A slug identifying the entity associated with the ledger.\n:type\
|
||
\ entity_slug: str\n:param pk: The primary key of the ledger whose journal entries\
|
||
\ are being unposted.\n:type pk: int\n:return: An HTTP redirect response object\
|
||
\ directing the client to the journal entry list\n page for the specified\
|
||
\ ledger.\n:rtype: HttpResponseRedirect"
|
||
source: inventory.views.ledger_unpost_all_journals
|
||
type: view_function
|
||
manage_reservation:
|
||
description: "Handles the management of a car reservation, providing options to\
|
||
\ renew or\ncancel an existing reservation associated with the logged-in user.\n\
|
||
\nRenewing a reservation extends the reservation period by an additional\n24\
|
||
\ hours. Canceling a reservation deletes it and updates the car's status\nto\
|
||
\ AVAILABLE. All actions require a valid reservation and are performed\nbased\
|
||
\ on the current user's authentication and request type.\n\n:param request:\
|
||
\ Django HttpRequest object representing the client's request.\n:type request:\
|
||
\ HttpRequest\n:param reservation_id: The unique identifier of the car reservation\
|
||
\ to manage.\n:type reservation_id: int\n:return: On POST requests, returns\
|
||
\ an HTTP redirect or JSON response\n based on the action performed. On other\
|
||
\ request methods,\n returns a JSON response with an error message.\n:rtype:\
|
||
\ JsonResponse or HttpResponseRedirect"
|
||
source: inventory.views.manage_reservation
|
||
type: view_function
|
||
opportunity_update_status:
|
||
description: "Update the status and/or stage of a specific Opportunity instance.\
|
||
\ This is a\nview function, which is generally tied to a URL endpoint in a Django\
|
||
\ application.\nThe function is accessible only to authenticated users due to\
|
||
\ the\n`@login_required` decorator.\n\nThe function retrieves the `Opportunity`\
|
||
\ instance based on the primary key\nin the URL, updates the status or stage\
|
||
\ of the instance based on query\nparameters in the request, saves the changes,\
|
||
\ and then redirects to the\ndetail view of the `Opportunity`. Additionally,\
|
||
\ a success message is displayed,\nand a custom header (`HX-Refresh`) is added\
|
||
\ to the response.\n\n:param request: The HTTP request object containing details\
|
||
\ of the user's\n request, such as query parameters for status and stage.\
|
||
\ This is a\n mandatory parameter provided by Django's view function framework.\n\
|
||
:type request: HttpRequest\n:param pk: The primary key of the `Opportunity`\
|
||
\ instance to be updated.\n:type pk: int\n\n:return: An HTTP response object\
|
||
\ that redirects to the updated Opportunity's\n detail page, with a success\
|
||
\ message and the \"HX-Refresh\" header to trigger\n frontend behavior.\n\
|
||
:rtype: HttpResponse"
|
||
source: inventory.views.opportunity_update_status
|
||
type: view_function
|
||
payment_mark_as_paid:
|
||
description: "Marks an invoice as paid if it meets the conditions of being fully\
|
||
\ paid and eligible\nfor payment. Also ensures that related ledger journal entries\
|
||
\ are locked and posted\nwhen the payment is marked successfully.\n\nThis function\
|
||
\ is protected with both `login_required` and\n`permission_required` decorators,\
|
||
\ ensuring that only logged-in users with\nappropriate permissions can execute\
|
||
\ it.\n\n:param request: HttpRequest object containing metadata about the request.\n\
|
||
:type request: HttpRequest\n:param pk: Primary key of the invoice to mark as\
|
||
\ paid.\n:type pk: int\n:return: Redirect response to the invoice detail page.\n\
|
||
:rtype: HttpResponseRedirect\n:raises: In case of an exception during the process,\
|
||
\ an error message is\n displayed to the user through Django's messaging\
|
||
\ framework."
|
||
source: inventory.views.payment_mark_as_paid
|
||
type: view_function
|
||
permission_required:
|
||
description: 'Decorator for views that checks whether a user has a particular
|
||
permission
|
||
|
||
enabled, redirecting to the log-in page if necessary.
|
||
|
||
If the raise_exception parameter is given the PermissionDenied exception
|
||
|
||
is raised.'
|
||
source: inventory.views.permission_required
|
||
type: view_function
|
||
preview_sale_order:
|
||
description: 'Handles rendering of the sale order preview page for a specific
|
||
estimate.
|
||
|
||
|
||
This view retrieves an `EstimateModel` object based on the provided primary
|
||
|
||
key (`pk`), fetches related car finance data, and renders the preview of the
|
||
|
||
sale order associated with the given estimate.
|
||
|
||
|
||
:param request: The HTTP request object
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param pk: The primary key of the `EstimateModel` to retrieve
|
||
|
||
:type pk: int
|
||
|
||
:return: HTTP response containing the rendered sale order preview page
|
||
|
||
:rtype: HttpResponse'
|
||
source: inventory.views.preview_sale_order
|
||
type: view_function
|
||
redirect:
|
||
description: "Return an HttpResponseRedirect to the appropriate URL for the arguments\n\
|
||
passed.\n\nThe arguments could be:\n\n * A model: the model's `get_absolute_url()`\
|
||
\ function will be called.\n\n * A view name, possibly with arguments: `urls.reverse()`\
|
||
\ will be used\n to reverse-resolve the name.\n\n * A URL, which will\
|
||
\ be used as-is for the redirect location.\n\nIssues a temporary redirect by\
|
||
\ default. Set permanent=True to issue a\npermanent redirect. Set preserve_request=True\
|
||
\ to instruct the user agent\nto preserve the original HTTP method and body\
|
||
\ when following the redirect."
|
||
source: appointment.views.redirect
|
||
type: view_function
|
||
render:
|
||
description: 'Return an HttpResponse whose content is filled with the result of
|
||
calling
|
||
|
||
django.template.loader.render_to_string() with the passed arguments.'
|
||
source: django_pdf_actions.views.render
|
||
type: view_function
|
||
reserve_car:
|
||
description: 'Reserve a car for a user for 24 hours and update its status to reserved.
|
||
|
||
|
||
The function creates a reservation record for the specified car, sets the
|
||
|
||
reservation expiration time, updates the car''s status, and notifies the user
|
||
|
||
about the operation outcome through success or error messages. It then redirects
|
||
|
||
to the car detail page.
|
||
|
||
|
||
:param car: The car object to be reserved.
|
||
|
||
:param request: The HTTP request object containing the user making the reservation.
|
||
|
||
:return: Redirection to the car''s detail page.'
|
||
source: inventory.views.reserve_car
|
||
type: view_function
|
||
reserve_car_view:
|
||
description: 'Handles car reservation requests. This view requires the user to
|
||
be logged in
|
||
|
||
and processes only POST requests. When invoked, it checks if the specified car
|
||
|
||
is already reserved. If not, it proceeds to reserve the car for the user and
|
||
|
||
sends an appropriate response. If the car is already reserved or if the request
|
||
|
||
method is invalid, it provides corresponding error messages or responses.
|
||
|
||
|
||
:param request: The HTTP request object.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param car_id: The unique identifier of the car to be reserved.
|
||
|
||
:type car_id: int
|
||
|
||
:return: A response indicating the result of the reservation process.
|
||
|
||
:rtype: HttpResponse or JsonResponse'
|
||
source: inventory.views.reserve_car_view
|
||
type: view_function
|
||
sales_list_view:
|
||
description: "Handles the retrieval and presentation of a paginated list of item\
|
||
\ transactions for\nsales, specific to the logged-in user's entity. Requires\
|
||
\ the user to have appropriate\npermissions to view the list.\n\n:param request:\
|
||
\ The HTTP request object containing metadata about the request,\n such as\
|
||
\ HTTP method, user credentials, and sent data.\n:type request: HttpRequest\n\
|
||
\n:return: An HTTP response with the rendered sales list page containing the\
|
||
\ paginated\n item transactions specific to the user's entity.\n:rtype: HttpResponse"
|
||
source: inventory.views.sales_list_view
|
||
type: view_function
|
||
schedule_cancel:
|
||
description: 'Cancel a schedule by updating its status to "Canceled". The function
|
||
is protected
|
||
|
||
by a login requirement, ensuring only authenticated users can execute it. It
|
||
|
||
retrieves the schedule object by its primary key, updates its status, saves
|
||
the
|
||
|
||
changes, and returns an HTTP response with status code 200.
|
||
|
||
|
||
:param request: The HTTP request object representing the user''s request.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param pk: The primary key of the schedule to be canceled.
|
||
|
||
:type pk: int
|
||
|
||
:return: An HTTP response object with a 200 status code upon successful execution.
|
||
|
||
:rtype: HttpResponse'
|
||
source: inventory.views.schedule_cancel
|
||
type: view_function
|
||
schedule_lead:
|
||
description: "Handles the scheduling of a lead for an appointment.\n\nThis function\
|
||
\ ensures that only staff members with the appropriate permissions\ncan schedule\
|
||
\ leads. If the user is not a staff member or does not have the\nrequired inventory\
|
||
\ permissions, they are redirected with an appropriate error\nmessage. The function\
|
||
\ creates an appointment request and an associated appointment\nrecord upon\
|
||
\ successful submission of the scheduling form.\n\n:param request: The HTTP\
|
||
\ request object containing metadata about the request.\n:type request: HttpRequest\n\
|
||
:param pk: The primary key of the lead to be scheduled.\n:type pk: int\n:return:\
|
||
\ A rendered template or a redirection to another view based on the request\n\
|
||
\ method and validity of the form submission.\n:rtype: HttpResponse"
|
||
source: inventory.views.schedule_lead
|
||
type: view_function
|
||
send_email_view:
|
||
description: 'View function to send an email for an estimate. This function allows
|
||
authenticated and
|
||
|
||
authorized users to send an email containing the estimate details to the customer.
|
||
|
||
The email includes a link to preview the estimate and a message template in
|
||
multiple
|
||
|
||
languages. If the estimate does not have any associated items, the user will
|
||
receive
|
||
|
||
an error message. Upon successfully sending the email, the estimate is marked
|
||
as reviewed.
|
||
|
||
|
||
:param request: The HttpRequest object containing metadata about the request.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param pk: The primary key of the estimate to be sent via email.
|
||
|
||
:type pk: int
|
||
|
||
:return: An HttpResponseRedirect to the estimate detail view.
|
||
|
||
:rtype: HttpResponseRedirect
|
||
|
||
:raises Http404: If the estimate with the given primary key does not exist.'
|
||
source: inventory.views.send_email_view
|
||
type: view_function
|
||
send_lead_email:
|
||
description: "Handles sending emails related to a lead. Supports creating drafts,\
|
||
\ sending emails, and rendering\nan email composition page. Changes on the lead\
|
||
\ or email objects, such as marking a lead as contacted\nor an email as sent,\
|
||
\ are recorded in associated activity logs.\n\n:param request: The HTTP request\
|
||
\ object. This contains user information, method type, and data such as\n \
|
||
\ GET or POST payload used to draft or send the email appropriately.\n\
|
||
\ Type: HttpRequest\n:param pk: The primary key of the lead to\
|
||
\ which the email action is associated. It's used to retrieve\n the\
|
||
\ lead object from the database.\n Type: int\n:param email_pk: Optional\
|
||
\ parameter representing the primary key of an email template. When provided,\n\
|
||
\ the respective email content is pre-populated into the email\
|
||
\ composition form.\n Defaults to None.\n Type:\
|
||
\ Optional[int]\n:return: When successfully sending an email, redirects the\
|
||
\ user to the lead list page. On draft mode\n or email composition rendering,\
|
||
\ a response object is returned to render the respective page.\n Type:\
|
||
\ HttpResponse"
|
||
source: inventory.views.send_lead_email
|
||
type: view_function
|
||
set_bill_payment:
|
||
description: 'Sets the payment for a given bill by creating journal entries for
|
||
the
|
||
|
||
transaction and updating the respective accounts and the bill''s status.
|
||
|
||
|
||
The function handles the transaction by creating a new journal entry
|
||
|
||
linked with the specified bill, then records debit and credit
|
||
|
||
transactions using the entity’s cash and accounts payable accounts.
|
||
|
||
It finally updates the bill''s payment status and persists changes.
|
||
|
||
|
||
:param dealer: The dealer making or receiving the payment.
|
||
|
||
:type dealer: Any
|
||
|
||
:param entity: The business entity involved in the payment transaction.
|
||
|
||
:type entity: Any
|
||
|
||
:param bill: The bill object representing the invoice to be paid.
|
||
|
||
:type bill: Any
|
||
|
||
:param amount: The amount to be paid for the bill.
|
||
|
||
:type amount: Decimal
|
||
|
||
:param payment_method: The method used to make the payment (e.g., cash, credit).
|
||
|
||
:type payment_method: Any
|
||
|
||
:return: None'
|
||
source: inventory.views.set_bill_payment
|
||
type: view_function
|
||
set_invoice_payment:
|
||
description: 'Processes and applies a payment for a specified invoice. This function
|
||
calculates
|
||
|
||
finance details, handles associated account transactions, and updates the invoice
|
||
|
||
status accordingly.
|
||
|
||
|
||
:param dealer: Dealer object responsible for processing the payment
|
||
|
||
:type dealer: Dealer
|
||
|
||
:param entity: Entity object associated with the invoice and payment
|
||
|
||
:type entity: Entity
|
||
|
||
:param invoice: The invoice object for which the payment is being made
|
||
|
||
:type invoice: Invoice
|
||
|
||
:param amount: The amount being paid towards the invoice
|
||
|
||
:type amount: Decimal
|
||
|
||
:param payment_method: The payment method used for the transaction
|
||
|
||
:type payment_method: str
|
||
|
||
:return: None'
|
||
source: inventory.views.set_invoice_payment
|
||
type: view_function
|
||
switch_language:
|
||
description: "Switches the current language context for the user based on a request\
|
||
\ parameter, modifies the URL path\naccordingly, and updates session and cookies\
|
||
\ with the new language preference.\n\n:param request: The HTTP request object\
|
||
\ containing information about the user request, including\n \
|
||
\ the desired language to switch to and the referring URL.\n \
|
||
\ - \"GET\" dictionary is accessed to retrieve the desired language parameter.\n\
|
||
\ - \"META\" dictionary is used to extract the referring URL\
|
||
\ via \"HTTP_REFERER\".\n\n:return: A redirect response object pointing to the\
|
||
\ modified URL with the updated language\n preference, if the requested\
|
||
\ language is valid. Otherwise, redirects to the default URL."
|
||
source: inventory.views.switch_language
|
||
type: view_function
|
||
urlparse:
|
||
description: 'Parse a URL into 6 components:
|
||
|
||
<scheme>://<netloc>/<path>;<params>?<query>#<fragment>
|
||
|
||
|
||
The result is a named 6-tuple with fields corresponding to the
|
||
|
||
above. It is either a ParseResult or ParseResultBytes object,
|
||
|
||
depending on the type of the url parameter.
|
||
|
||
|
||
The username, password, hostname, and port sub-components of netloc
|
||
|
||
can also be accessed as attributes of the returned object.
|
||
|
||
|
||
The scheme argument provides the default value of the scheme
|
||
|
||
component when no scheme is found in url.
|
||
|
||
|
||
If allow_fragments is False, no attempt is made to separate the
|
||
|
||
fragment component from the previous component, which can be either
|
||
|
||
path or query.
|
||
|
||
|
||
Note that % escapes are not expanded.'
|
||
source: inventory.views.urlparse
|
||
type: view_function
|
||
urlunparse:
|
||
description: 'Put a parsed URL back together again. This may result in a
|
||
|
||
slightly different, but equivalent URL, if the URL that was parsed
|
||
|
||
originally had redundant delimiters, e.g. a ? with an empty query
|
||
|
||
(the draft states that these are equivalent).'
|
||
source: inventory.views.urlunparse
|
||
type: view_function
|
||
vendorDetailView:
|
||
description: 'Fetches and renders the detail view for a specific vendor.
|
||
|
||
|
||
This function retrieves a vendor object based on the primary key (pk)
|
||
|
||
provided in the URL, ensures the user is logged in to access the
|
||
|
||
view, and renders the vendor detail template with the vendor''s context.
|
||
|
||
|
||
:param request: The HTTP request object.
|
||
|
||
:type request: HttpRequest
|
||
|
||
:param pk: The primary key of the vendor to retrieve.
|
||
|
||
:type pk: int
|
||
|
||
:return: An HttpResponse object containing the rendered vendor detail page.
|
||
|
||
:rtype: HttpResponse'
|
||
source: inventory.views.vendorDetailView
|
||
type: view_function
|
||
sync_user_email_addresses:
|
||
description: 'Keep user.email in sync with user.emailaddress_set.
|
||
|
||
|
||
Under some circumstances the user.email may not have ended up as
|
||
|
||
an EmailAddress record, e.g. in the case of manually created admin
|
||
|
||
users.'
|
||
source: allauth.account.views.sync_user_email_addresses
|
||
type: view_function
|
||
escape:
|
||
description: 'Return the given text with ampersands, quotes and angle brackets
|
||
encoded
|
||
|
||
for use in HTML.
|
||
|
||
|
||
Always escape input, even if it''s already escaped and marked as such.
|
||
|
||
This may result in double-escaping. If this is a concern, use
|
||
|
||
conditional_escape() instead.'
|
||
source: debug_toolbar.views.escape
|
||
type: view_function
|
||
render_panel:
|
||
description: Render the contents of a panel
|
||
source: debug_toolbar.views.render_panel
|
||
type: view_function
|
||
render_with_toolbar_language:
|
||
description: Force any rendering within the view to use the toolbar's language.
|
||
source: debug_toolbar.views.render_with_toolbar_language
|
||
type: view_function
|
||
require_show_toolbar:
|
||
description: 'Async compatible decorator to restrict access to a view
|
||
|
||
based on the Debug Toolbar''s visibility settings.'
|
||
source: debug_toolbar.views.require_show_toolbar
|
||
type: view_function
|
||
exception_handler:
|
||
description: 'Returns the response that should be used for any given exception.
|
||
|
||
|
||
By default we handle the REST framework `APIException`, and also
|
||
|
||
Django''s built-in `Http404` and `PermissionDenied` exceptions.
|
||
|
||
|
||
Any unhandled exceptions may return `None`, which will cause a 500 error
|
||
|
||
to be raised.'
|
||
source: rest_framework.views.exception_handler
|
||
type: view_function
|
||
get_view_description:
|
||
description: 'Given a view instance, return a textual description to represent
|
||
the view.
|
||
|
||
This name is used in the browsable API, and in OPTIONS responses.
|
||
|
||
|
||
This function is the default for the `VIEW_DESCRIPTION_FUNCTION` setting.'
|
||
source: rest_framework.views.get_view_description
|
||
type: view_function
|
||
get_view_name:
|
||
description: 'Given a view instance, return a textual name to represent the view.
|
||
|
||
This name is used in the browsable API, and in OPTIONS responses.
|
||
|
||
|
||
This function is the default for the `VIEW_NAME_FUNCTION` setting.'
|
||
source: rest_framework.views.get_view_name
|
||
type: view_function
|
||
patch_vary_headers:
|
||
description: 'Add (or update) the "Vary" header in the given HttpResponse object.
|
||
|
||
newheaders is a list of header names that should be in "Vary". If headers
|
||
|
||
contains an asterisk, then "Vary" header will consist of a single asterisk
|
||
|
||
''*''. Otherwise, existing headers in "Vary" aren''t removed.'
|
||
source: rest_framework.views.patch_vary_headers
|
||
type: view_function
|
||
smart_str:
|
||
description: 'Return a string representing ''s''. Treat bytestrings using the
|
||
''encoding''
|
||
|
||
codec.
|
||
|
||
|
||
If strings_only is True, don''t convert (some) non-string-like objects.'
|
||
source: rest_framework.views.smart_str
|
||
type: view_function
|
||
add_message:
|
||
description: Attempt to add a message to the request using the 'messages' app.
|
||
source: django_ledger.views.add_message
|
||
type: view_function
|
||
format_html:
|
||
description: 'Similar to str.format, but pass all arguments through conditional_escape(),
|
||
|
||
and call mark_safe() on the result. This function should be used instead
|
||
|
||
of str.format or % interpolation to build up small HTML fragments.'
|
||
source: django_ledger.views.format_html
|
||
type: view_function
|
||
get_localtime:
|
||
description: "Retrieve the local time based on the specified timezone.\n\nDetermines\
|
||
\ the local time depending on whether timezone support (``USE_TZ``) is\nenabled\
|
||
\ in global settings. If timezone support is enabled, it uses the\n`localtime`\
|
||
\ function to obtain the local time according to the provided\ntimezone. If\
|
||
\ timezone support is disabled, it defaults to the current time\nwith respect\
|
||
\ to the given timezone.\n\nParameters\n----------\ntz : timezone or None, optional\n\
|
||
\ The timezone to determine the local time. If `None`, defaults to the system\n\
|
||
\ timezone.\n\nReturns\n-------\ndatetime\n A datetime object representing\
|
||
\ the calculated local time."
|
||
source: django_ledger.views.get_localtime
|
||
type: view_function
|
||
make_aware:
|
||
description: Make a naive datetime.datetime in a given time zone aware.
|
||
source: django_ledger.views.make_aware
|
||
type: view_function
|
||
analyze_prompt_sync:
|
||
description: "Synchronous function to analyze a prompt and return insights.\n\
|
||
Perfect for Django views.\n\nArgs:\n prompt: Natural language query\n \
|
||
\ **kwargs: Additional parameters for InsightRequest\n\nReturns:\n Dictionary\
|
||
\ with query results"
|
||
source: haikalbot.views.analyze_prompt_sync
|
||
type: view_function
|
||
export_to_csv:
|
||
description: "Export data to CSV format.\n\nArgs:\n data: Data to export\n\
|
||
\ filename: Base filename without extension\n\nReturns:\n HttpResponse:\
|
||
\ Response with CSV file"
|
||
source: haikalbot.views.export_to_csv
|
||
type: view_function
|
||
export_to_excel:
|
||
description: "Export data to Excel format.\n\nArgs:\n data: Data to export\n\
|
||
\ filename: Base filename without extension\n\nReturns:\n HttpResponse:\
|
||
\ Response with Excel file"
|
||
source: haikalbot.views.export_to_excel
|
||
type: view_function
|
||
appointment_client_information:
|
||
description: 'This view function handles client information submission for an
|
||
appointment.
|
||
|
||
|
||
:param request: The request instance.
|
||
|
||
:param appointment_request_id: The ID of the appointment request.
|
||
|
||
:param id_request: The unique ID of the appointment request.
|
||
|
||
:return: The rendered HTML page.'
|
||
source: appointment.views.appointment_client_information
|
||
type: view_function
|
||
appointment_request:
|
||
description: 'This view function handles requests to book an appointment for a
|
||
service.
|
||
|
||
|
||
:param request: The request instance.
|
||
|
||
:param service_id: The ID of the service.
|
||
|
||
:param staff_member_id: The ID of the staff member.
|
||
|
||
:return: The rendered HTML page.'
|
||
source: appointment.views.appointment_request
|
||
type: view_function
|
||
appointment_request_submit:
|
||
description: 'This view function handles the submission of the appointment request
|
||
form.
|
||
|
||
|
||
:param request: The request instance.
|
||
|
||
:return: The rendered HTML page.'
|
||
source: appointment.views.appointment_request_submit
|
||
type: view_function
|
||
check_day_off_for_staff:
|
||
description: 'Check if the given staff member is off on the given date.
|
||
|
||
:param staff_member: The staff member to check.
|
||
|
||
:param date: The date to check.'
|
||
source: appointment.views.check_day_off_for_staff
|
||
type: view_function
|
||
check_q_cluster:
|
||
description: 'Checks if Django Q is properly installed and configured in the Django
|
||
settings.
|
||
|
||
If ''django_q'' is not in INSTALLED_APPS, it warns about both ''django_q'' not
|
||
being installed
|
||
|
||
and ''Q_CLUSTER'' likely not being configured.
|
||
|
||
If ''django_q'' is installed but ''Q_CLUSTER'' is not configured, it only warns
|
||
about ''Q_CLUSTER''.
|
||
|
||
Returns True if configurations are correct, otherwise False.'
|
||
source: appointment.views.check_q_cluster
|
||
type: view_function
|
||
convert_str_to_date:
|
||
description: "Convert a date string to a datetime date object.\n\n:param date_str:\
|
||
\ The date string.\n Supported formats include `%Y-%m-%d` (like\
|
||
\ \"2023-12-31\") and `%Y/%m/%d` (like \"2023/12/31\").\n:return: The converted\
|
||
\ `datetime.date`'s object."
|
||
source: appointment.views.convert_str_to_date
|
||
type: view_function
|
||
create_and_save_appointment:
|
||
description: 'Create and save a new appointment based on the provided appointment
|
||
request and client data.
|
||
|
||
|
||
:param ar: The appointment request associated with the new appointment.
|
||
|
||
:param client_data: The data of the client making the appointment.
|
||
|
||
:param appointment_data: Additional data for the appointment, including phone
|
||
number, address, etc.
|
||
|
||
:param request: The request object.
|
||
|
||
:return: The newly created appointment.'
|
||
source: appointment.views.create_and_save_appointment
|
||
type: view_function
|
||
create_appointment:
|
||
description: 'This function creates a new appointment and redirects to the payment
|
||
page or the thank-you page.
|
||
|
||
|
||
:param request: The request instance.
|
||
|
||
:param appointment_request_obj: The AppointmentRequest instance.
|
||
|
||
:param client_data: The client data.
|
||
|
||
:param appointment_data: The appointment data.
|
||
|
||
:return: The redirect response.'
|
||
source: appointment.views.create_appointment
|
||
type: view_function
|
||
create_payment_info_and_get_url:
|
||
description: 'Create a new payment information entry for the appointment and return
|
||
the payment URL.
|
||
|
||
|
||
:param appointment: The appointment to create the payment information for.
|
||
|
||
:return: The payment URL for the appointment.'
|
||
source: appointment.views.create_payment_info_and_get_url
|
||
type: view_function
|
||
default_thank_you:
|
||
description: 'This view function handles the default thank you page.
|
||
|
||
|
||
:param request: The request instance.
|
||
|
||
:param appointment_id: The ID of the appointment.
|
||
|
||
:return: The rendered HTML page.'
|
||
source: appointment.views.default_thank_you
|
||
type: view_function
|
||
enter_verification_code:
|
||
description: 'This view function handles the submission of the email verification
|
||
code.
|
||
|
||
|
||
:param request: The request instance.
|
||
|
||
:param appointment_request_id: The ID of the appointment request.
|
||
|
||
:param id_request: The unique ID of the appointment request.
|
||
|
||
:return: The rendered HTML page.'
|
||
source: appointment.views.enter_verification_code
|
||
type: view_function
|
||
force_str:
|
||
description: 'Similar to smart_str(), except that lazy instances are resolved
|
||
to
|
||
|
||
strings, rather than kept as lazy objects.
|
||
|
||
|
||
If strings_only is True, don''t convert (some) non-string-like objects.'
|
||
source: appointment.views.force_str
|
||
type: view_function
|
||
get_appointment_data_from_session:
|
||
description: 'Get the appointment data from the session variables.
|
||
|
||
Retrieves the phone, want_reminder, address, and additional_info stored in the
|
||
session.
|
||
|
||
|
||
:param request: The Django HttpRequest object.
|
||
|
||
:return: The appointment data retrieved from the session.'
|
||
source: appointment.views.get_appointment_data_from_session
|
||
type: view_function
|
||
get_appointments_and_slots:
|
||
description: "Get appointments and available slots for a given date and service.\n\
|
||
\nIf a service is provided, the function retrieves appointments for that service\
|
||
\ on the given date.\nOtherwise, it retrieves all appointments for the given\
|
||
\ date.\n\n:param date_: datetime.date, the date for which to retrieve appointments\
|
||
\ and available slots\n:param service: Service, the service for which to retrieve\
|
||
\ appointments\n:return: tuple, a tuple containing two elements:\n - A queryset\
|
||
\ of appointments for the given date and service (if provided).\n - A list\
|
||
\ of available time slots on the given date, excluding booked appointments."
|
||
source: appointment.views.get_appointments_and_slots
|
||
type: view_function
|
||
get_available_slots_ajax:
|
||
description: 'This view function handles AJAX requests to get available slots
|
||
for a selected date.
|
||
|
||
|
||
:param request: The request instance.
|
||
|
||
:return: A JSON response containing available slots, selected date, an error
|
||
flag, and an optional error message.'
|
||
source: appointment.views.get_available_slots_ajax
|
||
type: view_function
|
||
get_available_slots_for_staff:
|
||
description: 'Calculate the available time slots for a given date and a staff
|
||
member.
|
||
|
||
|
||
:param date: The date for which to calculate the available slots
|
||
|
||
:param staff_member: The staff member for which to calculate the available slots
|
||
|
||
:return: A list of available time slots as strings in the format ''%I:%M %p''
|
||
like [''10:00 AM'', ''10:30 AM'']'
|
||
source: appointment.views.get_available_slots_for_staff
|
||
type: view_function
|
||
get_current_timezone_name:
|
||
description: Return the name of the currently active time zone.
|
||
source: appointment.views.get_current_timezone_name
|
||
type: view_function
|
||
get_generic_context_with_extra:
|
||
description: Get the generic context for the admin pages with extra context.
|
||
source: appointment.views.get_generic_context_with_extra
|
||
type: view_function
|
||
get_locale:
|
||
description: 'Get the current locale based on the user''s language settings, without
|
||
the country code.
|
||
|
||
Used in the JavaScript files.
|
||
|
||
Can''t use the lang_country format because it is not supported.
|
||
|
||
|
||
:return: The current locale as a string (language code only)'
|
||
source: appointment.views.get_locale
|
||
type: view_function
|
||
get_next_available_date_ajax:
|
||
description: 'This view function handles AJAX requests to get the next available
|
||
date for a service.
|
||
|
||
|
||
:param request: The request instance.
|
||
|
||
:param service_id: The ID of the service.
|
||
|
||
:return: A JSON response containing the next available date.'
|
||
source: appointment.views.get_next_available_date_ajax
|
||
type: view_function
|
||
get_non_working_days_for_staff:
|
||
description: Return the non-working days for the given staff member or an empty
|
||
list if the staff member does not exist.
|
||
source: appointment.views.get_non_working_days_for_staff
|
||
type: view_function
|
||
get_user_by_email:
|
||
description: 'Get a user by their email address.
|
||
|
||
|
||
:param email: The email address of the user.
|
||
|
||
:return: The user with the specified email address, if found; otherwise, None.'
|
||
source: appointment.views.get_user_by_email
|
||
type: view_function
|
||
get_website_name:
|
||
description: 'Get the website name from the configuration file.
|
||
|
||
|
||
:return: The website name'
|
||
source: appointment.views.get_website_name
|
||
type: view_function
|
||
get_weekday_num_from_date:
|
||
description: Get the number of the weekday from the given date.
|
||
source: appointment.views.get_weekday_num_from_date
|
||
type: view_function
|
||
handle_existing_email:
|
||
description: 'Handle the case where the email already exists in the database.
|
||
|
||
|
||
Sends a verification email to the existing user and redirects the client to
|
||
enter the verification code.
|
||
|
||
|
||
If the email is already in the session variables, clean the session variables
|
||
for email, phone, want_reminder,
|
||
|
||
address, and additional_info. Then, store the current email, phone, want_reminder,
|
||
address, and additional_info
|
||
|
||
in the session.
|
||
|
||
|
||
:param request: The Django HttpRequest object.
|
||
|
||
:param client_data: The data of the client for the appointment.
|
||
|
||
:param appointment_data: The data of the appointment.
|
||
|
||
:param appointment_request_id: The ID of the appointment request.
|
||
|
||
:param id_request: The unique ID for the appointment request.
|
||
|
||
:return: The redirect response to enter the verification code.'
|
||
source: appointment.views.handle_existing_email
|
||
type: view_function
|
||
has_required_email_settings:
|
||
description: Check if all required email settings are configured and warn if any
|
||
are missing.
|
||
source: appointment.views.has_required_email_settings
|
||
type: view_function
|
||
is_working_day:
|
||
description: Check if the given day is a working day for the staff member.
|
||
source: appointment.views.is_working_day
|
||
type: view_function
|
||
json_response:
|
||
description: Return a generic JSON response.
|
||
source: appointment.views.json_response
|
||
type: view_function
|
||
login:
|
||
description: 'Persist a user id and a backend in the request. This way a user
|
||
doesn''t
|
||
|
||
have to reauthenticate on every request. Note that data set during
|
||
|
||
the anonymous session is retained when the user logs in.'
|
||
source: appointment.views.login
|
||
type: view_function
|
||
notify_admin_about_appointment:
|
||
description: Notify the admin and the staff member about a new appointment request.
|
||
source: appointment.views.notify_admin_about_appointment
|
||
type: view_function
|
||
notify_admin_about_reschedule:
|
||
description: Notify the admin and the staff member about a rescheduled appointment
|
||
request.
|
||
source: appointment.views.notify_admin_about_reschedule
|
||
type: view_function
|
||
redirect_to_payment_or_thank_you_page:
|
||
description: 'This function redirects to the payment page or the thank-you page
|
||
based on the configuration.
|
||
|
||
|
||
:param appointment: The Appointment instance.
|
||
|
||
:return: The redirect response.'
|
||
source: appointment.views.redirect_to_payment_or_thank_you_page
|
||
type: view_function
|
||
require_ajax:
|
||
description: 'Decorator to require a request to be AJAX.
|
||
|
||
Usage: @require_ajax'
|
||
source: appointment.views.require_ajax
|
||
type: view_function
|
||
send_reschedule_confirmation_email:
|
||
description: Send a rescheduling confirmation email to the client.
|
||
source: appointment.views.send_reschedule_confirmation_email
|
||
type: view_function
|
||
send_thank_you_email:
|
||
description: 'Send a thank-you email to the client for booking an appointment.
|
||
|
||
|
||
:param ar: The appointment request associated with the booking.
|
||
|
||
:param user: The user who booked the appointment.
|
||
|
||
:param email: The email address of the client.
|
||
|
||
:param appointment_details: Additional details about the appointment (default
|
||
None).
|
||
|
||
:param account_details: Additional details about the account (default None).
|
||
|
||
:param request: The request object.
|
||
|
||
:return: None'
|
||
source: appointment.views.send_thank_you_email
|
||
type: view_function
|
||
verify_user_and_login:
|
||
description: 'This function verifies the user''s email and logs the user in.
|
||
|
||
|
||
:param request: The request instance.
|
||
|
||
:param user: The User instance.
|
||
|
||
:param code: The verification code.'
|
||
source: appointment.views.verify_user_and_login
|
||
type: view_function
|
||
import_name:
|
||
description: import module given by str or pass the module if it is not str
|
||
source: plans.views.import_name
|
||
type: view_function
|
||
plan_validation:
|
||
description: 'Validates validator that represents quotas in a given system
|
||
|
||
:param user:
|
||
|
||
:param plan:
|
||
|
||
:return:'
|
||
source: plans.views.plan_validation
|
||
type: view_function
|
||
Site:
|
||
description: Site(id, domain, name)
|
||
source: sites.models.Site
|
||
type: model_class
|
||
LogEntry:
|
||
description: LogEntry(id, action_time, user, content_type, object_id, object_repr,
|
||
action_flag, change_message)
|
||
source: admin.models.LogEntry
|
||
type: model_class
|
||
Permission:
|
||
description: "The permissions system provides a way to assign permissions to specific\n\
|
||
users and groups of users.\n\nThe permission system is used by the Django admin\
|
||
\ site, but may also be\nuseful in your own code. The Django admin site uses\
|
||
\ permissions as follows:\n\n - The \"add\" permission limits the user's\
|
||
\ ability to view the \"add\" form\n and add an object.\n - The \"change\"\
|
||
\ permission limits a user's ability to view the change\n list, view the\
|
||
\ \"change\" form and change an object.\n - The \"delete\" permission limits\
|
||
\ the ability to delete an object.\n - The \"view\" permission limits the\
|
||
\ ability to view an object.\n\nPermissions are set globally per type of object,\
|
||
\ not per specific object\ninstance. It is possible to say \"Mary may change\
|
||
\ news stories,\" but it's\nnot currently possible to say \"Mary may change\
|
||
\ news stories, but only the\nones she created herself\" or \"Mary may only\
|
||
\ change news stories that have a\ncertain status or publication date.\"\n\n\
|
||
The permissions listed above are automatically created for each model."
|
||
source: auth.models.Permission
|
||
type: model_class
|
||
Group:
|
||
description: 'Groups are a generic way of categorizing users to apply permissions,
|
||
or
|
||
|
||
some other label, to those users. A user can belong to any number of
|
||
|
||
groups.
|
||
|
||
|
||
A user in a group automatically has all the permissions granted to that
|
||
|
||
group. For example, if the group ''Site editors'' has the permission
|
||
|
||
can_edit_home_page, any user in that group will have that permission.
|
||
|
||
|
||
Beyond permissions, groups are a convenient way to categorize users to
|
||
|
||
apply some label, or extended functionality, to them. For example, you
|
||
|
||
could create a group ''Special users'', and you could write code that would
|
||
|
||
do special things to those users -- such as giving them access to a
|
||
|
||
members-only portion of your site, or sending them members-only email
|
||
|
||
messages.'
|
||
source: auth.models.Group
|
||
type: model_class
|
||
User:
|
||
description: 'Users within the Django authentication system are represented by
|
||
this
|
||
|
||
model.
|
||
|
||
|
||
Username and password are required. Other fields are optional.'
|
||
source: auth.models.User
|
||
type: model_class
|
||
ContentType:
|
||
description: ContentType(id, app_label, model)
|
||
source: contenttypes.models.ContentType
|
||
type: model_class
|
||
Session:
|
||
description: 'Django provides full support for anonymous sessions. The session
|
||
|
||
framework lets you store and retrieve arbitrary data on a
|
||
|
||
per-site-visitor basis. It stores data on the server side and
|
||
|
||
abstracts the sending and receiving of cookies. Cookies contain a
|
||
|
||
session ID -- not the data itself.
|
||
|
||
|
||
The Django sessions framework is entirely cookie-based. It does
|
||
|
||
not fall back to putting session IDs in URLs. This is an intentional
|
||
|
||
design decision. Not only does that behavior make URLs ugly, it makes
|
||
|
||
your site vulnerable to session-ID theft via the "Referer" header.
|
||
|
||
|
||
For complete documentation on using Sessions in your code, consult
|
||
|
||
the sessions documentation that is shipped with Django (also available
|
||
|
||
on the Django web site).'
|
||
source: sessions.models.Session
|
||
type: model_class
|
||
DealersMake:
|
||
description: 'Represents the relationship between a car dealer and a car make.
|
||
|
||
|
||
This model establishes a many-to-many relationship between dealers and
|
||
|
||
car makes, allowing each dealer to be associated with multiple car makes
|
||
|
||
and each car make to be associated with multiple dealers. It also keeps
|
||
|
||
track of the date and time when the relationship was added.
|
||
|
||
|
||
:ivar dealer: The dealer associated with the car make.
|
||
|
||
:type dealer: ForeignKey
|
||
|
||
:ivar car_make: The car make associated with the dealer.
|
||
|
||
:type car_make: ForeignKey
|
||
|
||
:ivar added_at: The date and time when the relationship was created.
|
||
|
||
:type added_at: DateTimeField'
|
||
source: inventory.models.DealersMake
|
||
type: model_class
|
||
VatRate:
|
||
description: VatRate(id, rate, is_active, created_at)
|
||
source: inventory.models.VatRate
|
||
type: model_class
|
||
CarMake:
|
||
description: CarMake(id_car_make, name, slug, arabic_name, logo, is_sa_import,
|
||
car_type)
|
||
source: inventory.models.CarMake
|
||
type: model_class
|
||
CarModel:
|
||
description: CarModel(id_car_model, id_car_make, name, arabic_name, slug)
|
||
source: inventory.models.CarModel
|
||
type: model_class
|
||
CarSerie:
|
||
description: CarSerie(id_car_serie, id_car_model, name, arabic_name, year_begin,
|
||
year_end, generation_name, slug)
|
||
source: inventory.models.CarSerie
|
||
type: model_class
|
||
CarTrim:
|
||
description: CarTrim(id_car_trim, id_car_serie, name, arabic_name, start_production_year,
|
||
end_production_year, slug)
|
||
source: inventory.models.CarTrim
|
||
type: model_class
|
||
CarEquipment:
|
||
description: CarEquipment(id_car_equipment, id_car_trim, name, arabic_name, year_begin,
|
||
slug)
|
||
source: inventory.models.CarEquipment
|
||
type: model_class
|
||
CarSpecification:
|
||
description: CarSpecification(id_car_specification, name, arabic_name, id_parent,
|
||
slug)
|
||
source: inventory.models.CarSpecification
|
||
type: model_class
|
||
CarSpecificationValue:
|
||
description: CarSpecificationValue(id_car_specification_value, id_car_trim, id_car_specification,
|
||
value, unit)
|
||
source: inventory.models.CarSpecificationValue
|
||
type: model_class
|
||
CarOption:
|
||
description: CarOption(id_car_option, name, arabic_name, id_parent, slug)
|
||
source: inventory.models.CarOption
|
||
type: model_class
|
||
CarOptionValue:
|
||
description: CarOptionValue(id_car_option_value, id_car_option, id_car_equipment,
|
||
value, unit, is_base)
|
||
source: inventory.models.CarOptionValue
|
||
type: model_class
|
||
AdditionalServices:
|
||
description: AdditionalServices(id, name, arabic_name, description, price, taxable,
|
||
uom, dealer, item)
|
||
source: inventory.models.AdditionalServices
|
||
type: model_class
|
||
Car:
|
||
description: Car(id, slug, created_at, updated_at, item_model, vin, dealer, vendor,
|
||
id_car_make, id_car_model, year, id_car_serie, id_car_trim, status, stock_type,
|
||
remarks, mileage, receiving_date, hash)
|
||
source: inventory.models.Car
|
||
type: model_class
|
||
CarTransfer:
|
||
description: CarTransfer(id, car, from_dealer, to_dealer, transfer_date, quantity,
|
||
remarks, status, is_approved, active, created_at, updated_at)
|
||
source: inventory.models.CarTransfer
|
||
type: model_class
|
||
CarReservation:
|
||
description: CarReservation(id, car, reserved_by, reserved_at, reserved_until)
|
||
source: inventory.models.CarReservation
|
||
type: model_class
|
||
CarFinance:
|
||
description: CarFinance(id, car, cost_price, selling_price, discount_amount, is_sold)
|
||
source: inventory.models.CarFinance
|
||
type: model_class
|
||
ExteriorColors:
|
||
description: ExteriorColors(id, name, arabic_name, rgb)
|
||
source: inventory.models.ExteriorColors
|
||
type: model_class
|
||
InteriorColors:
|
||
description: InteriorColors(id, name, arabic_name, rgb)
|
||
source: inventory.models.InteriorColors
|
||
type: model_class
|
||
CarColors:
|
||
description: CarColors(id, car, exterior, interior)
|
||
source: inventory.models.CarColors
|
||
type: model_class
|
||
CustomCard:
|
||
description: CustomCard(id, car, custom_number, custom_date)
|
||
source: inventory.models.CustomCard
|
||
type: model_class
|
||
CarLocation:
|
||
description: CarLocation(id, car, owner, showroom, description, created_at, updated_at)
|
||
source: inventory.models.CarLocation
|
||
type: model_class
|
||
CarRegistration:
|
||
description: CarRegistration(id, car, plate_number, text1, text2, text3, registration_date)
|
||
source: inventory.models.CarRegistration
|
||
type: model_class
|
||
Dealer:
|
||
description: Dealer(id, user, crn, vrn, arabic_name, name, phone_number, address,
|
||
logo, entity, joined_at, updated_at, slug)
|
||
source: inventory.models.Dealer
|
||
type: model_class
|
||
Staff:
|
||
description: Staff(id, staff_member, dealer, name, arabic_name, phone_number,
|
||
staff_type, active, created, updated, slug)
|
||
source: inventory.models.Staff
|
||
type: model_class
|
||
Customer:
|
||
description: Customer(id, dealer, customer_model, user, title, first_name, last_name,
|
||
gender, dob, email, national_id, phone_number, address, active, image, created,
|
||
updated, slug)
|
||
source: inventory.models.Customer
|
||
type: model_class
|
||
Organization:
|
||
description: Organization(id, dealer, customer_model, user, name, arabic_name,
|
||
crn, vrn, email, phone_number, address, logo, active, created, updated, slug)
|
||
source: inventory.models.Organization
|
||
type: model_class
|
||
Representative:
|
||
description: Representative(id, dealer, name, arabic_name, id_number, phone_number,
|
||
email, address)
|
||
source: inventory.models.Representative
|
||
type: model_class
|
||
Lead:
|
||
description: Lead(id, dealer, first_name, last_name, email, phone_number, address,
|
||
lead_type, customer, organization, id_car_make, id_car_model, source, channel,
|
||
staff, status, next_action, next_action_date, is_converted, converted_at, created,
|
||
updated, slug)
|
||
source: inventory.models.Lead
|
||
type: model_class
|
||
Schedule:
|
||
description: Schedule(id, name, func, hook, args, kwargs, schedule_type, minutes,
|
||
repeats, next_run, cron, task, cluster, intended_date_kwarg)
|
||
source: django_q.models.Schedule
|
||
type: model_class
|
||
LeadStatusHistory:
|
||
description: LeadStatusHistory(id, lead, old_status, new_status, changed_by, changed_at)
|
||
source: inventory.models.LeadStatusHistory
|
||
type: model_class
|
||
Opportunity:
|
||
description: Opportunity(id, dealer, customer, organization, car, crn, vrn, salary,
|
||
priority, stage, staff, lead, probability, amount, expected_revenue, vehicle_of_interest_make,
|
||
vehicle_of_interest_model, expected_close_date, created, updated, estimate,
|
||
slug, loss_reason)
|
||
source: inventory.models.Opportunity
|
||
type: model_class
|
||
Notes:
|
||
description: Notes(id, dealer, content_type, object_id, note, created_by, created,
|
||
updated)
|
||
source: inventory.models.Notes
|
||
type: model_class
|
||
Tasks:
|
||
description: Tasks(id, dealer, content_type, object_id, title, description, due_date,
|
||
completed, assigned_to, created_by, created, updated)
|
||
source: inventory.models.Tasks
|
||
type: model_class
|
||
Email:
|
||
description: Email(id, content_type, object_id, from_email, to_email, subject,
|
||
message, status, created_by, created, updated)
|
||
source: inventory.models.Email
|
||
type: model_class
|
||
Activity:
|
||
description: Activity(id, dealer, content_type, object_id, activity_type, notes,
|
||
created_by, created, updated)
|
||
source: inventory.models.Activity
|
||
type: model_class
|
||
Notification:
|
||
description: Notification(id, user, message, is_read, created)
|
||
source: inventory.models.Notification
|
||
type: model_class
|
||
Vendor:
|
||
description: Vendor(id, dealer, crn, vrn, vendor_model, arabic_name, name, contact_person,
|
||
phone_number, email, address, logo, active, created_at, slug)
|
||
source: inventory.models.Vendor
|
||
type: model_class
|
||
Payment:
|
||
description: Payment(id, amount, payment_method, reference_number, payment_date)
|
||
source: inventory.models.Payment
|
||
type: model_class
|
||
Refund:
|
||
description: Refund(id, payment, amount, reason, refund_date)
|
||
source: inventory.models.Refund
|
||
type: model_class
|
||
UserActivityLog:
|
||
description: UserActivityLog(id, user, action, timestamp)
|
||
source: inventory.models.UserActivityLog
|
||
type: model_class
|
||
SaleOrder:
|
||
description: SaleOrder(id, estimate, invoice, payment_method, comments, formatted_order_id,
|
||
opportunity, customer, car, agreed_price, down_payment_amount, trade_in_value,
|
||
trade_in_vehicle, loan_amount, total_paid_amount, remaining_balance, status,
|
||
order_date, expected_delivery_date, actual_delivery_date, cancelled_date, cancellation_reason,
|
||
created_at, updated_at, created_by, last_modified_by)
|
||
source: inventory.models.SaleOrder
|
||
type: model_class
|
||
CustomGroup:
|
||
description: CustomGroup(id, name, dealer, group)
|
||
source: inventory.models.CustomGroup
|
||
type: model_class
|
||
DealerSettings:
|
||
description: DealerSettings(id, dealer, invoice_cash_account, invoice_prepaid_account,
|
||
invoice_unearned_account, bill_cash_account, bill_prepaid_account, bill_unearned_account,
|
||
additional_info)
|
||
source: inventory.models.DealerSettings
|
||
type: model_class
|
||
PaymentHistory:
|
||
description: PaymentHistory(id, user, user_data, amount, currency, payment_date,
|
||
status, payment_method, transaction_id, invoice_number, order_reference, gateway_response,
|
||
gateway_name, description, is_recurring, billing_email, billing_address, created_at,
|
||
updated_at)
|
||
source: inventory.models.PaymentHistory
|
||
type: model_class
|
||
CarVIN:
|
||
description: CarVIN(id, vin, created)
|
||
source: api.models.CarVIN
|
||
type: model_class
|
||
EmailAddress:
|
||
description: EmailAddress(id, user, email, verified, primary)
|
||
source: account.models.EmailAddress
|
||
type: model_class
|
||
EmailConfirmation:
|
||
description: EmailConfirmation(id, email_address, created, sent, key)
|
||
source: account.models.EmailConfirmation
|
||
type: model_class
|
||
SocialApp:
|
||
description: SocialApp(id, provider, provider_id, name, client_id, secret, key,
|
||
settings)
|
||
source: socialaccount.models.SocialApp
|
||
type: model_class
|
||
SocialAccount:
|
||
description: SocialAccount(id, user, provider, uid, last_login, date_joined, extra_data)
|
||
source: socialaccount.models.SocialAccount
|
||
type: model_class
|
||
SocialToken:
|
||
description: SocialToken(id, app, account, token, token_secret, expires_at)
|
||
source: socialaccount.models.SocialToken
|
||
type: model_class
|
||
Request:
|
||
description: Request(id, path, query_params, raw_body, body, method, start_time,
|
||
view_name, end_time, time_taken, encoded_headers, meta_time, meta_num_queries,
|
||
meta_time_spent_queries, pyprofile, prof_file, num_sql_queries)
|
||
source: silk.models.Request
|
||
type: model_class
|
||
Response:
|
||
description: Response(id, request, status_code, raw_body, body, encoded_headers)
|
||
source: silk.models.Response
|
||
type: model_class
|
||
SQLQuery:
|
||
description: SQLQuery(id, query, start_time, end_time, time_taken, identifier,
|
||
request, traceback, analysis)
|
||
source: silk.models.SQLQuery
|
||
type: model_class
|
||
Profile:
|
||
description: Profile(id, name, start_time, end_time, request, time_taken, file_path,
|
||
line_num, end_line_num, func_name, exception_raised, dynamic)
|
||
source: silk.models.Profile
|
||
type: model_class
|
||
Token:
|
||
description: The default authorization token model.
|
||
source: authtoken.models.Token
|
||
type: model_class
|
||
TokenProxy:
|
||
description: Proxy mapping pk to user pk for use in admin.
|
||
source: authtoken.models.TokenProxy
|
||
type: model_class
|
||
BankAccountModel:
|
||
description: Base Bank Account Model Implementation
|
||
source: django_ledger.models.BankAccountModel
|
||
type: model_class
|
||
AccountModel:
|
||
description: Base Account Model from Account Model Abstract Class
|
||
source: django_ledger.models.AccountModel
|
||
type: model_class
|
||
ChartOfAccountModel:
|
||
description: Base ChartOfAccounts Model
|
||
source: django_ledger.models.ChartOfAccountModel
|
||
type: model_class
|
||
CustomerModel:
|
||
description: Base Customer Model Implementation
|
||
source: django_ledger.models.CustomerModel
|
||
type: model_class
|
||
UnitOfMeasureModel:
|
||
description: Base UnitOfMeasureModel from Abstract.
|
||
source: django_ledger.models.UnitOfMeasureModel
|
||
type: model_class
|
||
ItemTransactionModel:
|
||
description: Base ItemTransactionModel from Abstract.
|
||
source: django_ledger.models.ItemTransactionModel
|
||
type: model_class
|
||
ItemModel:
|
||
description: Base ItemModel from Abstract.
|
||
source: django_ledger.models.ItemModel
|
||
type: model_class
|
||
LedgerModel:
|
||
description: Base LedgerModel from Abstract.
|
||
source: django_ledger.models.LedgerModel
|
||
type: model_class
|
||
EntityUnitModel:
|
||
description: Base Model Class for EntityUnitModel
|
||
source: django_ledger.models.EntityUnitModel
|
||
type: model_class
|
||
VendorModel:
|
||
description: Base Vendor Model Implementation
|
||
source: django_ledger.models.VendorModel
|
||
type: model_class
|
||
EntityModel:
|
||
description: Entity Model Base Class From Abstract
|
||
source: django_ledger.models.EntityModel
|
||
type: model_class
|
||
EntityStateModel:
|
||
description: Entity State Model Base Class from Abstract.
|
||
source: django_ledger.models.EntityStateModel
|
||
type: model_class
|
||
EntityManagementModel:
|
||
description: EntityManagement Model Base Class From Abstract
|
||
source: django_ledger.models.EntityManagementModel
|
||
type: model_class
|
||
BillModel:
|
||
description: Base BillModel from Abstract.
|
||
source: django_ledger.models.BillModel
|
||
type: model_class
|
||
InvoiceModel:
|
||
description: Base Invoice Model from Abstract.
|
||
source: django_ledger.models.InvoiceModel
|
||
type: model_class
|
||
TransactionModel:
|
||
description: Base Transaction Model From Abstract.
|
||
source: django_ledger.models.TransactionModel
|
||
type: model_class
|
||
JournalEntryModel:
|
||
description: Journal Entry Model Base Class From Abstract
|
||
source: django_ledger.models.JournalEntryModel
|
||
type: model_class
|
||
PurchaseOrderModel:
|
||
description: Purchase Order Base Model
|
||
source: django_ledger.models.PurchaseOrderModel
|
||
type: model_class
|
||
EstimateModel:
|
||
description: Base EstimateModel Class.
|
||
source: django_ledger.models.EstimateModel
|
||
type: model_class
|
||
ClosingEntryModel:
|
||
description: ClosingEntryModel(created, updated, markdown_notes, uuid, entity_model,
|
||
ledger_model, closing_date, posted)
|
||
source: django_ledger.models.ClosingEntryModel
|
||
type: model_class
|
||
ClosingEntryTransactionModel:
|
||
description: Base ClosingEntryModel Class
|
||
source: django_ledger.models.ClosingEntryTransactionModel
|
||
type: model_class
|
||
ImportJobModel:
|
||
description: Transaction Import Job Model Base Class.
|
||
source: django_ledger.models.ImportJobModel
|
||
type: model_class
|
||
StagedTransactionModel:
|
||
description: Staged Transaction Model Base Class.
|
||
source: django_ledger.models.StagedTransactionModel
|
||
type: model_class
|
||
ChatLog:
|
||
description: 'Handles storage and representation of chat logs between users and
|
||
chatbot.
|
||
|
||
|
||
This class is designed to store chat logs, which include user messages, chatbot
|
||
|
||
responses, their associated dealer, and timestamps of when the chat entries
|
||
are
|
||
|
||
created. It supports linking chat logs to a specific dealer using a foreign
|
||
key
|
||
|
||
relationship. The class provides an easy and structured way to manage and retrieve
|
||
|
||
historical chat data.
|
||
|
||
|
||
:ivar dealer: The dealer associated with this chat log.
|
||
|
||
:type dealer: Dealer
|
||
|
||
:ivar user_message: The message sent by the user.
|
||
|
||
:type user_message: str
|
||
|
||
:ivar chatbot_response: The response generated by the chatbot.
|
||
|
||
:type chatbot_response: str
|
||
|
||
:ivar timestamp: The date and time when the chat log entry was created.
|
||
|
||
:type timestamp: datetime'
|
||
source: haikalbot.models.ChatLog
|
||
type: model_class
|
||
AnalysisCache:
|
||
description: 'Model to cache analysis results for performance optimization.
|
||
|
||
|
||
This model stores cached results of model analysis operations to improve
|
||
|
||
performance for repeated queries. It includes a hash of the prompt, user
|
||
|
||
information, dealer ID, timestamps, and the cached result in JSON format.
|
||
|
||
|
||
:ivar prompt_hash: MD5 hash of the prompt + dealer_id + language
|
||
|
||
:type prompt_hash: str
|
||
|
||
:ivar user: The user who made the request (optional)
|
||
|
||
:type user: User
|
||
|
||
:ivar dealer_id: ID of the dealer associated with this cache entry
|
||
|
||
:type dealer_id: int
|
||
|
||
:ivar created_at: When the cache entry was created
|
||
|
||
:type created_at: datetime
|
||
|
||
:ivar updated_at: When the cache entry was last updated
|
||
|
||
:type updated_at: datetime
|
||
|
||
:ivar expires_at: When the cache entry expires
|
||
|
||
:type expires_at: datetime
|
||
|
||
:ivar result: The cached analysis result
|
||
|
||
:type result: dict'
|
||
source: haikalbot.models.AnalysisCache
|
||
type: model_class
|
||
Service:
|
||
description: 'Represents a service provided by the appointment system.
|
||
|
||
|
||
Author: Adams Pierre David
|
||
|
||
Version: 1.1.0
|
||
|
||
Since: 1.0.0'
|
||
source: appointment.models.Service
|
||
type: model_class
|
||
StaffMember:
|
||
description: StaffMember(id, user, slot_duration, lead_time, finish_time, appointment_buffer_time,
|
||
work_on_saturday, work_on_sunday, created_at, updated_at)
|
||
source: appointment.models.StaffMember
|
||
type: model_class
|
||
AppointmentRequest:
|
||
description: 'Represents an appointment request made by a client.
|
||
|
||
|
||
Author: Adams Pierre David
|
||
|
||
Since: 1.0.0'
|
||
source: appointment.models.AppointmentRequest
|
||
type: model_class
|
||
AppointmentRescheduleHistory:
|
||
description: AppointmentRescheduleHistory(id, appointment_request, date, start_time,
|
||
end_time, staff_member, reason_for_rescheduling, reschedule_status, id_request,
|
||
created_at, updated_at)
|
||
source: appointment.models.AppointmentRescheduleHistory
|
||
type: model_class
|
||
Appointment:
|
||
description: 'Represents an appointment made by a client. It is created when the
|
||
client confirms the appointment request.
|
||
|
||
|
||
Author: Adams Pierre David
|
||
|
||
Version: 1.1.0
|
||
|
||
Since: 1.0.0'
|
||
source: appointment.models.Appointment
|
||
type: model_class
|
||
Config:
|
||
description: 'Represents configuration settings for the appointment system. There
|
||
can only be one Config object in the database.
|
||
|
||
If you want to change the settings, you must edit the existing Config object.
|
||
|
||
|
||
Author: Adams Pierre David
|
||
|
||
Version: 1.1.0
|
||
|
||
Since: 1.1.0'
|
||
source: appointment.models.Config
|
||
type: model_class
|
||
PaymentInfo:
|
||
description: 'Represents payment information for an appointment.
|
||
|
||
|
||
Author: Adams Pierre David
|
||
|
||
Version: 1.1.0
|
||
|
||
Since: 1.0.0'
|
||
source: appointment.models.PaymentInfo
|
||
type: model_class
|
||
EmailVerificationCode:
|
||
description: 'Represents an email verification code for a user when the email
|
||
already exists in the database.
|
||
|
||
|
||
Author: Adams Pierre David
|
||
|
||
Version: 1.1.0
|
||
|
||
Since: 1.1.0'
|
||
source: appointment.models.EmailVerificationCode
|
||
type: model_class
|
||
PasswordResetToken:
|
||
description: 'Represents a password reset token for users.
|
||
|
||
|
||
Author: Adams Pierre David
|
||
|
||
Version: 3.x.x
|
||
|
||
Since: 3.x.x'
|
||
source: appointment.models.PasswordResetToken
|
||
type: model_class
|
||
DayOff:
|
||
description: DayOff(id, staff_member, start_date, end_date, description, created_at,
|
||
updated_at)
|
||
source: appointment.models.DayOff
|
||
type: model_class
|
||
WorkingHours:
|
||
description: WorkingHours(id, staff_member, day_of_week, start_time, end_time,
|
||
created_at, updated_at)
|
||
source: appointment.models.WorkingHours
|
||
type: model_class
|
||
Task:
|
||
description: Task(id, task_name, task_params, task_hash, verbose_name, priority,
|
||
run_at, repeat, repeat_until, queue, attempts, failed_at, last_error, locked_by,
|
||
locked_at, creator_content_type, creator_object_id)
|
||
source: background_task.models.Task
|
||
type: model_class
|
||
Success:
|
||
description: Success(id, name, func, hook, args, kwargs, result, group, cluster,
|
||
started, stopped, success, attempt_count)
|
||
source: django_q.models.Success
|
||
type: model_class
|
||
Failure:
|
||
description: Failure(id, name, func, hook, args, kwargs, result, group, cluster,
|
||
started, stopped, success, attempt_count)
|
||
source: django_q.models.Failure
|
||
type: model_class
|
||
OrmQ:
|
||
description: OrmQ(id, key, payload, lock)
|
||
source: django_q.models.OrmQ
|
||
type: model_class
|
||
Plan:
|
||
description: Plan(id, order, created, updated_at, name, description, default,
|
||
available, visible, customized, url)
|
||
source: plans.models.Plan
|
||
type: model_class
|
||
BillingInfo:
|
||
description: BillingInfo(id, created, updated_at, user, tax_number, name, street,
|
||
zipcode, city, country, shipping_name, shipping_street, shipping_zipcode, shipping_city)
|
||
source: plans.models.BillingInfo
|
||
type: model_class
|
||
UserPlan:
|
||
description: UserPlan(id, created, updated_at, user, plan, expire, active)
|
||
source: plans.models.UserPlan
|
||
type: model_class
|
||
Pricing:
|
||
description: Pricing(id, created, updated_at, name, period, url)
|
||
source: plans.models.Pricing
|
||
type: model_class
|
||
PlanPricing:
|
||
description: PlanPricing(id, created, updated_at, plan, pricing, price, order,
|
||
has_automatic_renewal, visible)
|
||
source: plans.models.PlanPricing
|
||
type: model_class
|
||
Quota:
|
||
description: Quota(id, order, created, updated_at, codename, name, unit, description,
|
||
is_boolean, url)
|
||
source: plans.models.Quota
|
||
type: model_class
|
||
PlanQuota:
|
||
description: PlanQuota(id, created, updated_at, plan, quota, value)
|
||
source: plans.models.PlanQuota
|
||
type: model_class
|
||
Order:
|
||
description: Order(id, created, updated_at, user, flat_name, plan, pricing, completed,
|
||
plan_extended_from, plan_extended_until, amount, tax, currency, status)
|
||
source: plans.models.Order
|
||
type: model_class
|
||
Invoice:
|
||
description: Invoice(id, created, updated_at, user, order, number, full_number,
|
||
type, issued, issued_duplicate, selling_date, payment_date, unit_price_net,
|
||
quantity, total_net, total, tax_total, tax, rebate, currency, item_description,
|
||
buyer_name, buyer_street, buyer_zipcode, buyer_city, buyer_country, buyer_tax_number,
|
||
shipping_name, shipping_street, shipping_zipcode, shipping_city, shipping_country,
|
||
require_shipment, issuer_name, issuer_street, issuer_zipcode, issuer_city, issuer_country,
|
||
issuer_tax_number)
|
||
source: plans.models.Invoice
|
||
type: model_class
|
||
RecurringUserPlan:
|
||
description: RecurringUserPlan(id, created, updated_at, user_plan, token, payment_provider,
|
||
pricing, amount, tax, currency, renewal_triggered_by, _has_automatic_renewal_backup_deprecated,
|
||
token_verified, card_expire_year, card_expire_month, card_masked_number)
|
||
source: plans.models.RecurringUserPlan
|
||
type: model_class
|
||
Sequence:
|
||
description: Sequence(name, last)
|
||
source: sequences.models.Sequence
|
||
type: model_class
|
||
ExportPDFSettings:
|
||
description: ExportPDFSettings(id, created, modified, title, active, page_size,
|
||
items_per_page, page_margin_mm, font_name, header_font_size, body_font_size,
|
||
logo, header_background_color, grid_line_color, grid_line_width, show_header,
|
||
show_logo, show_export_time, show_page_numbers, rtl_support, content_alignment,
|
||
header_alignment, title_alignment, table_spacing, max_chars_per_line)
|
||
source: django_pdf_actions.models.ExportPDFSettings
|
||
type: model_class
|
||
CompletedTask:
|
||
description: CompletedTask(id, task_name, task_params, task_hash, verbose_name,
|
||
priority, run_at, repeat, repeat_until, queue, attempts, failed_at, last_error,
|
||
locked_by, locked_at, creator_content_type, creator_object_id)
|
||
source: background_task.models.CompletedTask
|
||
type: model_class
|
||
user_workflows:
|
||
Add New Car:
|
||
description: How to add a new car to the inventory
|
||
steps:
|
||
- Navigate to the Inventory section by clicking 'Inventory' in the main menu
|
||
- Click the 'Add Car' button in the top right corner
|
||
- Enter the VIN number or scan it using the barcode scanner
|
||
- Select the car make from the dropdown menu
|
||
- Select the car series from the available options
|
||
- Select the trim level for the car
|
||
- Fill in additional details like color, mileage, and price
|
||
- Click 'Save' to add the car to inventory, or 'Save & Add Another' to continue
|
||
adding cars
|
||
source: manual_documentation
|
||
Create New Invoice:
|
||
description: How to create a new invoice
|
||
steps:
|
||
- Navigate to the Finance section by clicking 'Finance' in the main menu
|
||
- Click the 'Invoices' tab
|
||
- Click the 'Create New Invoice' button
|
||
- Select a customer from the dropdown or click 'Add New Customer'
|
||
- Select the car(s) to include in the invoice
|
||
- Add any additional services or parts by clicking 'Add Item'
|
||
- Set the payment terms and due date
|
||
- Click 'Save Draft' to save without finalizing, or 'Finalize Invoice' to complete
|
||
source: manual_documentation
|
||
templates: {}
|
||
glossary: {}
|