app.utils
NotEqual
NotEqual(self, lhs, rhs)
Allow lookup and exclusion using not equal.
lookup_name
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
as_sql
NotEqual.as_sql(self, compiler, connection)
Handle as SQL method for not equal lookup.
setup_lang
setup_lang(request, user)
Handle setting the user's language preferences and store in the session.
Args: request (Request): The Django request object. user (User): The Django user object.
Raises: DoesNotExist: The exception is raised if no profile is found for the specified handle.
handle_location_request
handle_location_request(request)
Handle determining location data from request IP.
get_location_from_ip
get_location_from_ip(ip_address)
Get the location associated with the provided IP address.
Args: ip_address (str): The IP address to lookup.
Returns: dict: The GeoIP location data dictionary.
get_country_from_ip
get_country_from_ip(ip_address)
Get the user's country information from the provided IP address.
clean_str
clean_str(string)
Clean the provided string of all non-alpha numeric characters.
get_profile
get_profile(request)
Get the current profile from the provided request.
Returns: dashboard.models.Profile: The current user's Profile.
CustomGithubOAuth2
CustomGithubOAuth2(self, strategy=None, *args, **kwargs)
EXTRA_DATA
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
timeout
timeout(max_timeout)
Timeout decorator, parameter in seconds.
allow_all_origins
allow_all_origins(response)
Pass in a response and add header to allow all CORs requests