privex.helpers.django¶
This module file contains Django-specific helper functions, to help save time when developing with the Django framework.
handle_error - Redirects normal web page requests with a session error, outputs JSON with a status code for API queries.
is_database_synchronized - Check if all migrations have been ran before running code.
model_to_dict - Extract an individual Django model instance into a dict (with display names)
to_json - Convert a model Queryset into a plain string JSON array with display names
Copyright:
+===================================================+
| © 2019 Privex Inc. |
| https://www.privex.io |
+===================================================+
| |
| Originally Developed by Privex Inc. |
| License: X11 / MIT |
| |
| Core Developer(s): |
| |
| (+) Chris (@someguy123) [Privex] |
| (+) Kale (@kryogenic) [Privex] |
| |
+===================================================+
Copyright 2019 Privex Inc. ( https://www.privex.io )
Functions
|
Output an error as either a Django session message + redirect, or a JSON response based on whether the request was for the API readable version (?format=json) or not. |
|
Check if all migrations have been ran. |
|
1 dimensional json-ifyer for any Model |
|
Iterate a Django query set and dump to json str |