IndexedRedis (version 6.0.2)
index

# Copyright (c) 2014, 2015, 2016, 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information.
#  IndexedRedis A redis-backed very very fast ORM-style framework that supports indexes, and searches with O(1) efficency.
#    It has syntax similar to Django and Flask and other ORMs, but is itself unique in many ways.

 
Package Contents
       
IRQueryableList
compat_convert
compat_str
deprecated
fields (package)
timed
utils

 
Classes
       
builtins.Exception(builtins.BaseException)
InvalidModelException
builtins.object
IndexedRedisHelper
IndexedRedisDelete
IndexedRedisQuery
IndexedRedisSave
IndexedRedisModel
builtins.str(builtins.object)
IndexedRedis.fields.IRField
IndexedRedis.fields.chain.IRFieldChain
IndexedRedis.fields.foreign.IRForeignLinkFieldBase

 
class IRField(builtins.str)
    IRField - An advanced field
 
If a type is defined other than default/str/bytes/None , an empty value (empty string in Redis) will be assigned to the IRNullType instance provided in this module, irNull.
irNull does not equal anything except irNull (or another IRNullType). Use this to check if a value has been assigned for other types.
 
BE VERY CAREFUL ABOUT USING "float" as a type! It is an inprecise field and can vary from system to system. Instead of using a float,
consider using fields.IRFixedPointField, which is indexable.
 
An IRField may be indexable (depending on the type), and has the option to hash the index
 
 
Method resolution order:
IRField
builtins.str
builtins.object

Methods defined here:
__init__(self, name='', valueType=<class 'str'>, defaultValue=irNull, hashIndex=False)
__init__ - Create an IRField. Use this directly in the FIELDS array for advanced functionality on a field.
 
@param name <str> - The name of this field
 
@param valueType <type> - The type that will be used for this field. Default str/unicode (and bytes on python2)
        act the same as non-IRField FIELDS entries (just plain string), i.e. they are encoded to unicode to and from Redis.
 
        If you pass in None, then no decoding will take place (so whatever you provide goes in, and bytes come out of Redis).
        This is similar to IRFieldRaw
 
        On python3, if you pass bytes, than the field will be left as bytes.
        To be both python2 and python3 compatible, however, you can use IRBytesField
 
        If bool is used, then "1" and "true" are True, "0" and "false" are False, any other value is an exception.
 
        You can also pass an advanced type (see IndexedRedis.fields.FieldValueTypes) like datetime and json.
 
        All types other than string/unicode/bytes/None will be assigned 'irNull' if they were not provided a value.
        @see irNull - Equals only irNull (or other IRNullType instances). You can use this to check if an integer is defined versus 0, for example.
 
        While this class is create for primitive types (like int's and datetimes), more complex types extend IRField (such as pickle, compressed, or unicode with a specific encoding).
 
@param defaultValue <any> (default irNull) - The value assigned to this field as a "default", i.e. when no value has yet been set. Generally, it makes sense to keep this as irNull, but you may want a different default.
 
@param hashIndex <bool> (default False) - If true, the md5 hash of the value will be used for indexing and filtering. This may be useful for very long fields.
 
An IRField may be indexable (depending on the type), and has the option to hash the index
 
NOTE: If you are extending IRField, you should probably not call this __init__ function. So long as you implement your own "convert", any fields used are set on a class-level.
__repr__(self)
__repr__ - Return an object-representation string of this field instance.
 
You should NOT need to extend this on your IRField, instead just implement _getReprProperties
 
  to return your type's specific properties associated with this instance.
 
  @see _getReprProperties
convert = _deprecated_wrapper(*args, **kwargs)
copy(self)
copy - Create a copy of this IRField.
 
  Each subclass should implement this, as you'll need to pass in the args to constructor.
 
@return <IRField (or subclass)> - Another IRField that has all the same values as this one.
fromInput(self, value)
fromInput - Convert the value from input (like assigning this through constructor or as an item assignment on the object
 
@param value - Value to convert
 
@return - Converted value
fromStorage(self, value)
fromStorage - Convert the value from storage to the value type.
 
@param value - Value to convert
 
@return - The converted value
getDefaultValue(self)
getDefaultValue - Gets the default value associated with this field.
 
  This is the value used when no value has been explicitly set.
 
  @return - The default value
toIndex(self, value)
toIndex - An optional method which will return the value prepped for index.
 
By default, "toStorage" will be called. If you provide "hashIndex=True" on the constructor,
the field will be md5summed for indexing purposes. This is useful for large strings, etc.
toStorage(self, value)
toStorage - Convert the value to a string representation for storage.
 
  The default implementation will work here for basic types.
 
@param value - The value of the item to convert
@return A string value suitable for storing.

Static methods defined here:
__new__(self, name='', valueType=None, defaultValue=irNull, hashIndex=False)
Create and return a new object.  See help(type) for accurate signature.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
isIndexHashed
isIndexHashed - Returns if the index value should be hashed
 
@return <bool> - True if this field should be hashed before indexing / filtering
name
name - Property, return this field's name
 
@return <str> - Field name

Data and other attributes defined here:
CAN_INDEX = False
defaultValue = irNull
hashIndex = False

Methods inherited from builtins.str:
__add__(self, value, /)
Return self+value.
__contains__(self, key, /)
Return key in self.
__eq__(self, value, /)
Return self==value.
__format__(...)
S.__format__(format_spec) -> str
 
Return a formatted version of S as described by format_spec.
__ge__(self, value, /)
Return self>=value.
__getattribute__(self, name, /)
Return getattr(self, name).
__getitem__(self, key, /)
Return self[key].
__getnewargs__(...)
__gt__(self, value, /)
Return self>value.
__hash__(self, /)
Return hash(self).
__iter__(self, /)
Implement iter(self).
__le__(self, value, /)
Return self<=value.
__len__(self, /)
Return len(self).
__lt__(self, value, /)
Return self<value.
__mod__(self, value, /)
Return self%value.
__mul__(self, value, /)
Return self*value.n
__ne__(self, value, /)
Return self!=value.
__rmod__(self, value, /)
Return value%self.
__rmul__(self, value, /)
Return self*value.
__sizeof__(...)
S.__sizeof__() -> size of S in memory, in bytes
__str__(self, /)
Return str(self).
capitalize(...)
S.capitalize() -> str
 
Return a capitalized version of S, i.e. make the first character
have upper case and the rest lower case.
casefold(...)
S.casefold() -> str
 
Return a version of S suitable for caseless comparisons.
center(...)
S.center(width[, fillchar]) -> str
 
Return S centered in a string of length width. Padding is
done using the specified fill character (default is a space)
count(...)
S.count(sub[, start[, end]]) -> int
 
Return the number of non-overlapping occurrences of substring sub in
string S[start:end].  Optional arguments start and end are
interpreted as in slice notation.
encode(...)
S.encode(encoding='utf-8', errors='strict') -> bytes
 
Encode S using the codec registered for encoding. Default encoding
is 'utf-8'. errors may be given to set a different error
handling scheme. Default is 'strict' meaning that encoding errors raise
a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and
'xmlcharrefreplace' as well as any other name registered with
codecs.register_error that can handle UnicodeEncodeErrors.
endswith(...)
S.endswith(suffix[, start[, end]]) -> bool
 
Return True if S ends with the specified suffix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
suffix can also be a tuple of strings to try.
expandtabs(...)
S.expandtabs(tabsize=8) -> str
 
Return a copy of S where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
find(...)
S.find(sub[, start[, end]]) -> int
 
Return the lowest index in S where substring sub is found,
such that sub is contained within S[start:end].  Optional
arguments start and end are interpreted as in slice notation.
 
Return -1 on failure.
format(...)
S.format(*args, **kwargs) -> str
 
Return a formatted version of S, using substitutions from args and kwargs.
The substitutions are identified by braces ('{' and '}').
format_map(...)
S.format_map(mapping) -> str
 
Return a formatted version of S, using substitutions from mapping.
The substitutions are identified by braces ('{' and '}').
index(...)
S.index(sub[, start[, end]]) -> int
 
Like S.find() but raise ValueError when the substring is not found.
isalnum(...)
S.isalnum() -> bool
 
Return True if all characters in S are alphanumeric
and there is at least one character in S, False otherwise.
isalpha(...)
S.isalpha() -> bool
 
Return True if all characters in S are alphabetic
and there is at least one character in S, False otherwise.
isdecimal(...)
S.isdecimal() -> bool
 
Return True if there are only decimal characters in S,
False otherwise.
isdigit(...)
S.isdigit() -> bool
 
Return True if all characters in S are digits
and there is at least one character in S, False otherwise.
isidentifier(...)
S.isidentifier() -> bool
 
Return True if S is a valid identifier according
to the language definition.
 
Use keyword.iskeyword() to test for reserved identifiers
such as "def" and "class".
islower(...)
S.islower() -> bool
 
Return True if all cased characters in S are lowercase and there is
at least one cased character in S, False otherwise.
isnumeric(...)
S.isnumeric() -> bool
 
Return True if there are only numeric characters in S,
False otherwise.
isprintable(...)
S.isprintable() -> bool
 
Return True if all characters in S are considered
printable in repr() or S is empty, False otherwise.
isspace(...)
S.isspace() -> bool
 
Return True if all characters in S are whitespace
and there is at least one character in S, False otherwise.
istitle(...)
S.istitle() -> bool
 
Return True if S is a titlecased string and there is at least one
character in S, i.e. upper- and titlecase characters may only
follow uncased characters and lowercase characters only cased ones.
Return False otherwise.
isupper(...)
S.isupper() -> bool
 
Return True if all cased characters in S are uppercase and there is
at least one cased character in S, False otherwise.
join(...)
S.join(iterable) -> str
 
Return a string which is the concatenation of the strings in the
iterable.  The separator between elements is S.
ljust(...)
S.ljust(width[, fillchar]) -> str
 
Return S left-justified in a Unicode string of length width. Padding is
done using the specified fill character (default is a space).
lower(...)
S.lower() -> str
 
Return a copy of the string S converted to lowercase.
lstrip(...)
S.lstrip([chars]) -> str
 
Return a copy of the string S with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
partition(...)
S.partition(sep) -> (head, sep, tail)
 
Search for the separator sep in S, and return the part before it,
the separator itself, and the part after it.  If the separator is not
found, return S and two empty strings.
replace(...)
S.replace(old, new[, count]) -> str
 
Return a copy of S with all occurrences of substring
old replaced by new.  If the optional argument count is
given, only the first count occurrences are replaced.
rfind(...)
S.rfind(sub[, start[, end]]) -> int
 
Return the highest index in S where substring sub is found,
such that sub is contained within S[start:end].  Optional
arguments start and end are interpreted as in slice notation.
 
Return -1 on failure.
rindex(...)
S.rindex(sub[, start[, end]]) -> int
 
Like S.rfind() but raise ValueError when the substring is not found.
rjust(...)
S.rjust(width[, fillchar]) -> str
 
Return S right-justified in a string of length width. Padding is
done using the specified fill character (default is a space).
rpartition(...)
S.rpartition(sep) -> (head, sep, tail)
 
Search for the separator sep in S, starting at the end of S, and return
the part before it, the separator itself, and the part after it.  If the
separator is not found, return two empty strings and S.
rsplit(...)
S.rsplit(sep=None, maxsplit=-1) -> list of strings
 
Return a list of the words in S, using sep as the
delimiter string, starting at the end of the string and
working to the front.  If maxsplit is given, at most maxsplit
splits are done. If sep is not specified, any whitespace string
is a separator.
rstrip(...)
S.rstrip([chars]) -> str
 
Return a copy of the string S with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
split(...)
S.split(sep=None, maxsplit=-1) -> list of strings
 
Return a list of the words in S, using sep as the
delimiter string.  If maxsplit is given, at most maxsplit
splits are done. If sep is not specified or is None, any
whitespace string is a separator and empty strings are
removed from the result.
splitlines(...)
S.splitlines([keepends]) -> list of strings
 
Return a list of the lines in S, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends
is given and true.
startswith(...)
S.startswith(prefix[, start[, end]]) -> bool
 
Return True if S starts with the specified prefix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
prefix can also be a tuple of strings to try.
strip(...)
S.strip([chars]) -> str
 
Return a copy of the string S with leading and trailing
whitespace removed.
If chars is given and not None, remove characters in chars instead.
swapcase(...)
S.swapcase() -> str
 
Return a copy of S with uppercase characters converted to lowercase
and vice versa.
title(...)
S.title() -> str
 
Return a titlecased version of S, i.e. words start with title case
characters, all remaining cased characters have lower case.
translate(...)
S.translate(table) -> str
 
Return a copy of the string S in which each character has been mapped
through the given translation table. The table must implement
lookup/indexing via __getitem__, for instance a dictionary or list,
mapping Unicode ordinals to Unicode ordinals, strings, or None. If
this operation raises LookupError, the character is left untouched.
Characters mapped to None are deleted.
upper(...)
S.upper() -> str
 
Return a copy of S converted to uppercase.
zfill(...)
S.zfill(width) -> str
 
Pad a numeric string S with zeros on the left, to fill a field
of the specified width. The string S is never truncated.

Static methods inherited from builtins.str:
maketrans(x, y=None, z=None, /)
Return a translation table usable for str.translate().
 
If there is only one argument, it must be a dictionary mapping Unicode
ordinals (integers) or characters to Unicode ordinals, strings or None.
Character keys will be then converted to ordinals.
If there are two arguments, they must be strings of equal length, and
in the resulting dictionary, each character in x will be mapped to the
character at the same position in y. If there is a third argument, it
must be a string, whose characters will be mapped to None in the result.

 
class IRFieldChain(IndexedRedis.fields.IRField)
    IRFieldChain -
 
These chain together the operations from multiple fields.
 
toStorage is applied left-to-right,
fromInput and fromStorage is applied right-to-left.
 
The output of one field is the input of the next.
 
An IRFieldChain is indexable so long as ALL of its contained fields are indexable.
An IRFieldChain is forced to be a hashed index if the rightmost field forces it (as some types do),
  otherwise hashIndex will determine if it is hashed.
 
 
Method resolution order:
IRFieldChain
IndexedRedis.fields.IRField
builtins.str
builtins.object

Methods defined here:
__init__(self, name, chainedFields, defaultValue=irNull, hashIndex=False)
__init__ - Create an IRFieldChain object.
 
  These chain together the operations from multiple fields.
 
  toStorage is applied left-to-right,
  fromInput and fromStorage is applied right-to-left.
 
  The output of one field is the input of the next.
 
   An IRFieldChain is indexable so long as ALL of its contained fields are indexable.
   An IRFieldChain is forced to be a hashed index if the rightmost field forces it (as some types do),
     otherwise hashIndex will determine if it is hashed.
 
@see IRField.__init__
copy(self)
copy - Create a copy of this IRField.
 
  Each subclass should implement this, as you'll need to pass in the args to constructor.
 
@return <IRField (or subclass)> - Another IRField that has all the same values as this one.

Static methods defined here:
__new__(self, name, chainedFields=None, defaultValue=irNull, hashIndex=False)
Create and return a new object.  See help(type) for accurate signature.

Data and other attributes defined here:
CAN_INDEX = False

Methods inherited from IndexedRedis.fields.IRField:
__repr__(self)
__repr__ - Return an object-representation string of this field instance.
 
You should NOT need to extend this on your IRField, instead just implement _getReprProperties
 
  to return your type's specific properties associated with this instance.
 
  @see _getReprProperties
convert = _deprecated_wrapper(*args, **kwargs)
fromInput(self, value)
fromInput - Convert the value from input (like assigning this through constructor or as an item assignment on the object
 
@param value - Value to convert
 
@return - Converted value
fromStorage(self, value)
fromStorage - Convert the value from storage to the value type.
 
@param value - Value to convert
 
@return - The converted value
getDefaultValue(self)
getDefaultValue - Gets the default value associated with this field.
 
  This is the value used when no value has been explicitly set.
 
  @return - The default value
toIndex(self, value)
toIndex - An optional method which will return the value prepped for index.
 
By default, "toStorage" will be called. If you provide "hashIndex=True" on the constructor,
the field will be md5summed for indexing purposes. This is useful for large strings, etc.
toStorage(self, value)
toStorage - Convert the value to a string representation for storage.
 
  The default implementation will work here for basic types.
 
@param value - The value of the item to convert
@return A string value suitable for storing.

Data descriptors inherited from IndexedRedis.fields.IRField:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
isIndexHashed
isIndexHashed - Returns if the index value should be hashed
 
@return <bool> - True if this field should be hashed before indexing / filtering
name
name - Property, return this field's name
 
@return <str> - Field name

Data and other attributes inherited from IndexedRedis.fields.IRField:
defaultValue = irNull
hashIndex = False

Methods inherited from builtins.str:
__add__(self, value, /)
Return self+value.
__contains__(self, key, /)
Return key in self.
__eq__(self, value, /)
Return self==value.
__format__(...)
S.__format__(format_spec) -> str
 
Return a formatted version of S as described by format_spec.
__ge__(self, value, /)
Return self>=value.
__getattribute__(self, name, /)
Return getattr(self, name).
__getitem__(self, key, /)
Return self[key].
__getnewargs__(...)
__gt__(self, value, /)
Return self>value.
__hash__(self, /)
Return hash(self).
__iter__(self, /)
Implement iter(self).
__le__(self, value, /)
Return self<=value.
__len__(self, /)
Return len(self).
__lt__(self, value, /)
Return self<value.
__mod__(self, value, /)
Return self%value.
__mul__(self, value, /)
Return self*value.n
__ne__(self, value, /)
Return self!=value.
__rmod__(self, value, /)
Return value%self.
__rmul__(self, value, /)
Return self*value.
__sizeof__(...)
S.__sizeof__() -> size of S in memory, in bytes
__str__(self, /)
Return str(self).
capitalize(...)
S.capitalize() -> str
 
Return a capitalized version of S, i.e. make the first character
have upper case and the rest lower case.
casefold(...)
S.casefold() -> str
 
Return a version of S suitable for caseless comparisons.
center(...)
S.center(width[, fillchar]) -> str
 
Return S centered in a string of length width. Padding is
done using the specified fill character (default is a space)
count(...)
S.count(sub[, start[, end]]) -> int
 
Return the number of non-overlapping occurrences of substring sub in
string S[start:end].  Optional arguments start and end are
interpreted as in slice notation.
encode(...)
S.encode(encoding='utf-8', errors='strict') -> bytes
 
Encode S using the codec registered for encoding. Default encoding
is 'utf-8'. errors may be given to set a different error
handling scheme. Default is 'strict' meaning that encoding errors raise
a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and
'xmlcharrefreplace' as well as any other name registered with
codecs.register_error that can handle UnicodeEncodeErrors.
endswith(...)
S.endswith(suffix[, start[, end]]) -> bool
 
Return True if S ends with the specified suffix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
suffix can also be a tuple of strings to try.
expandtabs(...)
S.expandtabs(tabsize=8) -> str
 
Return a copy of S where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
find(...)
S.find(sub[, start[, end]]) -> int
 
Return the lowest index in S where substring sub is found,
such that sub is contained within S[start:end].  Optional
arguments start and end are interpreted as in slice notation.
 
Return -1 on failure.
format(...)
S.format(*args, **kwargs) -> str
 
Return a formatted version of S, using substitutions from args and kwargs.
The substitutions are identified by braces ('{' and '}').
format_map(...)
S.format_map(mapping) -> str
 
Return a formatted version of S, using substitutions from mapping.
The substitutions are identified by braces ('{' and '}').
index(...)
S.index(sub[, start[, end]]) -> int
 
Like S.find() but raise ValueError when the substring is not found.
isalnum(...)
S.isalnum() -> bool
 
Return True if all characters in S are alphanumeric
and there is at least one character in S, False otherwise.
isalpha(...)
S.isalpha() -> bool
 
Return True if all characters in S are alphabetic
and there is at least one character in S, False otherwise.
isdecimal(...)
S.isdecimal() -> bool
 
Return True if there are only decimal characters in S,
False otherwise.
isdigit(...)
S.isdigit() -> bool
 
Return True if all characters in S are digits
and there is at least one character in S, False otherwise.
isidentifier(...)
S.isidentifier() -> bool
 
Return True if S is a valid identifier according
to the language definition.
 
Use keyword.iskeyword() to test for reserved identifiers
such as "def" and "class".
islower(...)
S.islower() -> bool
 
Return True if all cased characters in S are lowercase and there is
at least one cased character in S, False otherwise.
isnumeric(...)
S.isnumeric() -> bool
 
Return True if there are only numeric characters in S,
False otherwise.
isprintable(...)
S.isprintable() -> bool
 
Return True if all characters in S are considered
printable in repr() or S is empty, False otherwise.
isspace(...)
S.isspace() -> bool
 
Return True if all characters in S are whitespace
and there is at least one character in S, False otherwise.
istitle(...)
S.istitle() -> bool
 
Return True if S is a titlecased string and there is at least one
character in S, i.e. upper- and titlecase characters may only
follow uncased characters and lowercase characters only cased ones.
Return False otherwise.
isupper(...)
S.isupper() -> bool
 
Return True if all cased characters in S are uppercase and there is
at least one cased character in S, False otherwise.
join(...)
S.join(iterable) -> str
 
Return a string which is the concatenation of the strings in the
iterable.  The separator between elements is S.
ljust(...)
S.ljust(width[, fillchar]) -> str
 
Return S left-justified in a Unicode string of length width. Padding is
done using the specified fill character (default is a space).
lower(...)
S.lower() -> str
 
Return a copy of the string S converted to lowercase.
lstrip(...)
S.lstrip([chars]) -> str
 
Return a copy of the string S with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
partition(...)
S.partition(sep) -> (head, sep, tail)
 
Search for the separator sep in S, and return the part before it,
the separator itself, and the part after it.  If the separator is not
found, return S and two empty strings.
replace(...)
S.replace(old, new[, count]) -> str
 
Return a copy of S with all occurrences of substring
old replaced by new.  If the optional argument count is
given, only the first count occurrences are replaced.
rfind(...)
S.rfind(sub[, start[, end]]) -> int
 
Return the highest index in S where substring sub is found,
such that sub is contained within S[start:end].  Optional
arguments start and end are interpreted as in slice notation.
 
Return -1 on failure.
rindex(...)
S.rindex(sub[, start[, end]]) -> int
 
Like S.rfind() but raise ValueError when the substring is not found.
rjust(...)
S.rjust(width[, fillchar]) -> str
 
Return S right-justified in a string of length width. Padding is
done using the specified fill character (default is a space).
rpartition(...)
S.rpartition(sep) -> (head, sep, tail)
 
Search for the separator sep in S, starting at the end of S, and return
the part before it, the separator itself, and the part after it.  If the
separator is not found, return two empty strings and S.
rsplit(...)
S.rsplit(sep=None, maxsplit=-1) -> list of strings
 
Return a list of the words in S, using sep as the
delimiter string, starting at the end of the string and
working to the front.  If maxsplit is given, at most maxsplit
splits are done. If sep is not specified, any whitespace string
is a separator.
rstrip(...)
S.rstrip([chars]) -> str
 
Return a copy of the string S with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
split(...)
S.split(sep=None, maxsplit=-1) -> list of strings
 
Return a list of the words in S, using sep as the
delimiter string.  If maxsplit is given, at most maxsplit
splits are done. If sep is not specified or is None, any
whitespace string is a separator and empty strings are
removed from the result.
splitlines(...)
S.splitlines([keepends]) -> list of strings
 
Return a list of the lines in S, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends
is given and true.
startswith(...)
S.startswith(prefix[, start[, end]]) -> bool
 
Return True if S starts with the specified prefix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
prefix can also be a tuple of strings to try.
strip(...)
S.strip([chars]) -> str
 
Return a copy of the string S with leading and trailing
whitespace removed.
If chars is given and not None, remove characters in chars instead.
swapcase(...)
S.swapcase() -> str
 
Return a copy of S with uppercase characters converted to lowercase
and vice versa.
title(...)
S.title() -> str
 
Return a titlecased version of S, i.e. words start with title case
characters, all remaining cased characters have lower case.
translate(...)
S.translate(table) -> str
 
Return a copy of the string S in which each character has been mapped
through the given translation table. The table must implement
lookup/indexing via __getitem__, for instance a dictionary or list,
mapping Unicode ordinals to Unicode ordinals, strings, or None. If
this operation raises LookupError, the character is left untouched.
Characters mapped to None are deleted.
upper(...)
S.upper() -> str
 
Return a copy of S converted to uppercase.
zfill(...)
S.zfill(width) -> str
 
Pad a numeric string S with zeros on the left, to fill a field
of the specified width. The string S is never truncated.

Static methods inherited from builtins.str:
maketrans(x, y=None, z=None, /)
Return a translation table usable for str.translate().
 
If there is only one argument, it must be a dictionary mapping Unicode
ordinals (integers) or characters to Unicode ordinals, strings or None.
Character keys will be then converted to ordinals.
If there are two arguments, they must be strings of equal length, and
in the resulting dictionary, each character in x will be mapped to the
character at the same position in y. If there is a third argument, it
must be a string, whose characters will be mapped to None in the result.

 
class IRForeignLinkFieldBase(IndexedRedis.fields.IRField)
    IRForeignLinkFieldBase - Base class for Foreign Link fields
 
 
Method resolution order:
IRForeignLinkFieldBase
IndexedRedis.fields.IRField
builtins.str
builtins.object

Methods inherited from IndexedRedis.fields.IRField:
__init__(self, name='', valueType=<class 'str'>, defaultValue=irNull, hashIndex=False)
__init__ - Create an IRField. Use this directly in the FIELDS array for advanced functionality on a field.
 
@param name <str> - The name of this field
 
@param valueType <type> - The type that will be used for this field. Default str/unicode (and bytes on python2)
        act the same as non-IRField FIELDS entries (just plain string), i.e. they are encoded to unicode to and from Redis.
 
        If you pass in None, then no decoding will take place (so whatever you provide goes in, and bytes come out of Redis).
        This is similar to IRFieldRaw
 
        On python3, if you pass bytes, than the field will be left as bytes.
        To be both python2 and python3 compatible, however, you can use IRBytesField
 
        If bool is used, then "1" and "true" are True, "0" and "false" are False, any other value is an exception.
 
        You can also pass an advanced type (see IndexedRedis.fields.FieldValueTypes) like datetime and json.
 
        All types other than string/unicode/bytes/None will be assigned 'irNull' if they were not provided a value.
        @see irNull - Equals only irNull (or other IRNullType instances). You can use this to check if an integer is defined versus 0, for example.
 
        While this class is create for primitive types (like int's and datetimes), more complex types extend IRField (such as pickle, compressed, or unicode with a specific encoding).
 
@param defaultValue <any> (default irNull) - The value assigned to this field as a "default", i.e. when no value has yet been set. Generally, it makes sense to keep this as irNull, but you may want a different default.
 
@param hashIndex <bool> (default False) - If true, the md5 hash of the value will be used for indexing and filtering. This may be useful for very long fields.
 
An IRField may be indexable (depending on the type), and has the option to hash the index
 
NOTE: If you are extending IRField, you should probably not call this __init__ function. So long as you implement your own "convert", any fields used are set on a class-level.
__repr__(self)
__repr__ - Return an object-representation string of this field instance.
 
You should NOT need to extend this on your IRField, instead just implement _getReprProperties
 
  to return your type's specific properties associated with this instance.
 
  @see _getReprProperties
convert = _deprecated_wrapper(*args, **kwargs)
copy(self)
copy - Create a copy of this IRField.
 
  Each subclass should implement this, as you'll need to pass in the args to constructor.
 
@return <IRField (or subclass)> - Another IRField that has all the same values as this one.
fromInput(self, value)
fromInput - Convert the value from input (like assigning this through constructor or as an item assignment on the object
 
@param value - Value to convert
 
@return - Converted value
fromStorage(self, value)
fromStorage - Convert the value from storage to the value type.
 
@param value - Value to convert
 
@return - The converted value
getDefaultValue(self)
getDefaultValue - Gets the default value associated with this field.
 
  This is the value used when no value has been explicitly set.
 
  @return - The default value
toIndex(self, value)
toIndex - An optional method which will return the value prepped for index.
 
By default, "toStorage" will be called. If you provide "hashIndex=True" on the constructor,
the field will be md5summed for indexing purposes. This is useful for large strings, etc.
toStorage(self, value)
toStorage - Convert the value to a string representation for storage.
 
  The default implementation will work here for basic types.
 
@param value - The value of the item to convert
@return A string value suitable for storing.

Static methods inherited from IndexedRedis.fields.IRField:
__new__(self, name='', valueType=None, defaultValue=irNull, hashIndex=False)
Create and return a new object.  See help(type) for accurate signature.

Data descriptors inherited from IndexedRedis.fields.IRField:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
isIndexHashed
isIndexHashed - Returns if the index value should be hashed
 
@return <bool> - True if this field should be hashed before indexing / filtering
name
name - Property, return this field's name
 
@return <str> - Field name

Data and other attributes inherited from IndexedRedis.fields.IRField:
CAN_INDEX = False
defaultValue = irNull
hashIndex = False

Methods inherited from builtins.str:
__add__(self, value, /)
Return self+value.
__contains__(self, key, /)
Return key in self.
__eq__(self, value, /)
Return self==value.
__format__(...)
S.__format__(format_spec) -> str
 
Return a formatted version of S as described by format_spec.
__ge__(self, value, /)
Return self>=value.
__getattribute__(self, name, /)
Return getattr(self, name).
__getitem__(self, key, /)
Return self[key].
__getnewargs__(...)
__gt__(self, value, /)
Return self>value.
__hash__(self, /)
Return hash(self).
__iter__(self, /)
Implement iter(self).
__le__(self, value, /)
Return self<=value.
__len__(self, /)
Return len(self).
__lt__(self, value, /)
Return self<value.
__mod__(self, value, /)
Return self%value.
__mul__(self, value, /)
Return self*value.n
__ne__(self, value, /)
Return self!=value.
__rmod__(self, value, /)
Return value%self.
__rmul__(self, value, /)
Return self*value.
__sizeof__(...)
S.__sizeof__() -> size of S in memory, in bytes
__str__(self, /)
Return str(self).
capitalize(...)
S.capitalize() -> str
 
Return a capitalized version of S, i.e. make the first character
have upper case and the rest lower case.
casefold(...)
S.casefold() -> str
 
Return a version of S suitable for caseless comparisons.
center(...)
S.center(width[, fillchar]) -> str
 
Return S centered in a string of length width. Padding is
done using the specified fill character (default is a space)
count(...)
S.count(sub[, start[, end]]) -> int
 
Return the number of non-overlapping occurrences of substring sub in
string S[start:end].  Optional arguments start and end are
interpreted as in slice notation.
encode(...)
S.encode(encoding='utf-8', errors='strict') -> bytes
 
Encode S using the codec registered for encoding. Default encoding
is 'utf-8'. errors may be given to set a different error
handling scheme. Default is 'strict' meaning that encoding errors raise
a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and
'xmlcharrefreplace' as well as any other name registered with
codecs.register_error that can handle UnicodeEncodeErrors.
endswith(...)
S.endswith(suffix[, start[, end]]) -> bool
 
Return True if S ends with the specified suffix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
suffix can also be a tuple of strings to try.
expandtabs(...)
S.expandtabs(tabsize=8) -> str
 
Return a copy of S where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
find(...)
S.find(sub[, start[, end]]) -> int
 
Return the lowest index in S where substring sub is found,
such that sub is contained within S[start:end].  Optional
arguments start and end are interpreted as in slice notation.
 
Return -1 on failure.
format(...)
S.format(*args, **kwargs) -> str
 
Return a formatted version of S, using substitutions from args and kwargs.
The substitutions are identified by braces ('{' and '}').
format_map(...)
S.format_map(mapping) -> str
 
Return a formatted version of S, using substitutions from mapping.
The substitutions are identified by braces ('{' and '}').
index(...)
S.index(sub[, start[, end]]) -> int
 
Like S.find() but raise ValueError when the substring is not found.
isalnum(...)
S.isalnum() -> bool
 
Return True if all characters in S are alphanumeric
and there is at least one character in S, False otherwise.
isalpha(...)
S.isalpha() -> bool
 
Return True if all characters in S are alphabetic
and there is at least one character in S, False otherwise.
isdecimal(...)
S.isdecimal() -> bool
 
Return True if there are only decimal characters in S,
False otherwise.
isdigit(...)
S.isdigit() -> bool
 
Return True if all characters in S are digits
and there is at least one character in S, False otherwise.
isidentifier(...)
S.isidentifier() -> bool
 
Return True if S is a valid identifier according
to the language definition.
 
Use keyword.iskeyword() to test for reserved identifiers
such as "def" and "class".
islower(...)
S.islower() -> bool
 
Return True if all cased characters in S are lowercase and there is
at least one cased character in S, False otherwise.
isnumeric(...)
S.isnumeric() -> bool
 
Return True if there are only numeric characters in S,
False otherwise.
isprintable(...)
S.isprintable() -> bool
 
Return True if all characters in S are considered
printable in repr() or S is empty, False otherwise.
isspace(...)
S.isspace() -> bool
 
Return True if all characters in S are whitespace
and there is at least one character in S, False otherwise.
istitle(...)
S.istitle() -> bool
 
Return True if S is a titlecased string and there is at least one
character in S, i.e. upper- and titlecase characters may only
follow uncased characters and lowercase characters only cased ones.
Return False otherwise.
isupper(...)
S.isupper() -> bool
 
Return True if all cased characters in S are uppercase and there is
at least one cased character in S, False otherwise.
join(...)
S.join(iterable) -> str
 
Return a string which is the concatenation of the strings in the
iterable.  The separator between elements is S.
ljust(...)
S.ljust(width[, fillchar]) -> str
 
Return S left-justified in a Unicode string of length width. Padding is
done using the specified fill character (default is a space).
lower(...)
S.lower() -> str
 
Return a copy of the string S converted to lowercase.
lstrip(...)
S.lstrip([chars]) -> str
 
Return a copy of the string S with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
partition(...)
S.partition(sep) -> (head, sep, tail)
 
Search for the separator sep in S, and return the part before it,
the separator itself, and the part after it.  If the separator is not
found, return S and two empty strings.
replace(...)
S.replace(old, new[, count]) -> str
 
Return a copy of S with all occurrences of substring
old replaced by new.  If the optional argument count is
given, only the first count occurrences are replaced.
rfind(...)
S.rfind(sub[, start[, end]]) -> int
 
Return the highest index in S where substring sub is found,
such that sub is contained within S[start:end].  Optional
arguments start and end are interpreted as in slice notation.
 
Return -1 on failure.
rindex(...)
S.rindex(sub[, start[, end]]) -> int
 
Like S.rfind() but raise ValueError when the substring is not found.
rjust(...)
S.rjust(width[, fillchar]) -> str
 
Return S right-justified in a string of length width. Padding is
done using the specified fill character (default is a space).
rpartition(...)
S.rpartition(sep) -> (head, sep, tail)
 
Search for the separator sep in S, starting at the end of S, and return
the part before it, the separator itself, and the part after it.  If the
separator is not found, return two empty strings and S.
rsplit(...)
S.rsplit(sep=None, maxsplit=-1) -> list of strings
 
Return a list of the words in S, using sep as the
delimiter string, starting at the end of the string and
working to the front.  If maxsplit is given, at most maxsplit
splits are done. If sep is not specified, any whitespace string
is a separator.
rstrip(...)
S.rstrip([chars]) -> str
 
Return a copy of the string S with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
split(...)
S.split(sep=None, maxsplit=-1) -> list of strings
 
Return a list of the words in S, using sep as the
delimiter string.  If maxsplit is given, at most maxsplit
splits are done. If sep is not specified or is None, any
whitespace string is a separator and empty strings are
removed from the result.
splitlines(...)
S.splitlines([keepends]) -> list of strings
 
Return a list of the lines in S, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends
is given and true.
startswith(...)
S.startswith(prefix[, start[, end]]) -> bool
 
Return True if S starts with the specified prefix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
prefix can also be a tuple of strings to try.
strip(...)
S.strip([chars]) -> str
 
Return a copy of the string S with leading and trailing
whitespace removed.
If chars is given and not None, remove characters in chars instead.
swapcase(...)
S.swapcase() -> str
 
Return a copy of S with uppercase characters converted to lowercase
and vice versa.
title(...)
S.title() -> str
 
Return a titlecased version of S, i.e. words start with title case
characters, all remaining cased characters have lower case.
translate(...)
S.translate(table) -> str
 
Return a copy of the string S in which each character has been mapped
through the given translation table. The table must implement
lookup/indexing via __getitem__, for instance a dictionary or list,
mapping Unicode ordinals to Unicode ordinals, strings, or None. If
this operation raises LookupError, the character is left untouched.
Characters mapped to None are deleted.
upper(...)
S.upper() -> str
 
Return a copy of S converted to uppercase.
zfill(...)
S.zfill(width) -> str
 
Pad a numeric string S with zeros on the left, to fill a field
of the specified width. The string S is never truncated.

Static methods inherited from builtins.str:
maketrans(x, y=None, z=None, /)
Return a translation table usable for str.translate().
 
If there is only one argument, it must be a dictionary mapping Unicode
ordinals (integers) or characters to Unicode ordinals, strings or None.
Character keys will be then converted to ordinals.
If there are two arguments, they must be strings of equal length, and
in the resulting dictionary, each character in x will be mapped to the
character at the same position in y. If there is a third argument, it
must be a string, whose characters will be mapped to None in the result.

 
class IndexedRedisDelete(IndexedRedisHelper)
    IndexedRedisDelete - Used for removing objects. Called when Model.delete is used.
        Except for advanced usage, this is probably for internal only.
 
 
Method resolution order:
IndexedRedisDelete
IndexedRedisHelper
builtins.object

Methods defined here:
deleteByPk(self, pk)
deleteByPk - Delete object associated with given primary key
deleteMultiple(self, objs)
deleteMultiple - Delete multiple objects
 
@param objs - List of objects
 
@return - Number of objects deleted
deleteMultipleByPks(self, pks)
deleteMultipleByPks - Delete multiple objects given their primary keys
 
@param pks - List of primary keys
 
@return - Number of objects deleted
deleteOne(self, obj, conn=None)
deleteOne - Delete one object
 
@param obj - object to delete
@param conn - Connection to reuse, or None
 
@return - number of items deleted (0 or 1)
destroyModel(self)
destroyModel - Destroy everything related to this model in one swoop.
 
    Same effect as Model.reset([]) - Except slightly more efficient.
 
    This function is called if you do Model.objects.delete() with no filters set.
 
@return - Number of keys deleted. Note, this is NOT number of models deleted, but total keys.

Methods inherited from IndexedRedisHelper:
__copy__(self)
__deepcopy__ = __copy__(self)
__init__(self, mdl)
Internal constructor
 
@param mdl - IndexedRedisModel implementer

Data descriptors inherited from IndexedRedisHelper:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class IndexedRedisHelper(builtins.object)
    IndexedRedisHelper - internal helper class which ties together all the actions
 
  Methods defined here:
__copy__(self)
__deepcopy__ = __copy__(self)
__init__(self, mdl)
Internal constructor
 
@param mdl - IndexedRedisModel implementer

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class IndexedRedisModel(builtins.object)
    IndexedRedisModel - This is the model you should extend.
 
     See: https://github.com/kata198/indexedredis/blob/master/README.md for documentation
 
 
 **Attributes**
 
     FIELDS - An array of IRField objects, which define the fields on this model.
 
     INDEXED_FIELDS - The field names on which to index
 
     KEY_NAME - A string of the "key" name which will be used for this model
 
     REDIS_CONNECTION_PARAMS - A dict which provides fields to override over the inherited default Redis connection
 
  
  **Basic Usage**
 
    The basic model for usage is,
 
     # Filtering
 
    MyModel.objects.filter(field1='value1', field2__ne='notvalue2').all()   # Fetch all objects where field1 is "value1" and field2 is not "notvalue2"
 
     # Creating / Saving object
 
    myObj = MyModel()
 
    myObj.field1 = 'value1'
 
    myObj.save()
 
    
    There are many more methods and usage, etc, see pydoc or README for more information.
 
  Methods defined here:
__copy__(self)
 __copy__ - Used by the "copy" module to make a copy,
   which will NOT be linked to the original entry in the database, but will contain the same data
 
@return <IndexedRedisModel> - Copy of this object, per above
__deepcopy__(self, *args, **kwargs)
 __deepcopy__ - Used by the "copy" module to make a deepcopy.
 
   Will perform a deepcopy of all attributes, which will NOT be linked to the original entry in the database.
 
 
   If you need a copy that IS linked, @see IndexedRedisModel.copy
 
@return <IndexedRedisModel> - Deep copy of this object, per above
__eq__(self, other)
__eq__ - Check if two IndexedRedisModels are equal.
 
They are equal if they have the same type and same field values (including id).
 
To check if two models have the same values (but can have different ids), use #hasSameValues method.
__getattribute__(self, keyName)
Return getattr(self, name).
__getstate__(self)
pickle uses this
__init__(self, *args, **kwargs)
__init__ - Set the values on this object. MAKE SURE YOU CALL THE SUPER HERE, or else things will not work.
__ne__(self, other)
__ne__ - Check if two IndexedRedisModels are NOT equal.
 
@see IndexedRedisModel.__eq__
__repr__(self)
__repr__ - Returns a string of the constructor/params to recreate this object.
    Example: objCopy = eval(repr(obj))
 
    @return - String of python init call to recreate this object
__setattr__(self, keyName, value)
__setattr__ - Will be used to set an attribute on this object.
 
  If the attribute is a field (in self.FIELDS), it will be converted via the field type's #fromInput method.
 
  Otherwise, it will just set the attribute on this object.
__setstate__(self, stateDict)
pickle uses this
__str__(self)
__str__ - Returns a string representation of this object's state.
    See implementation.
 
@return <str>- 
    Some samples:
    (Pdb) str(z)
    '<Song obj _id=24 at 0x7f3c6a3a4490>'
    (Pdb) z.artist = 'New Artist'
    (Pdb) str(z)
    '<Song obj _id=24 (Unsaved Changes) at 0x7f3c6a3a4490>'
asDict(self, includeMeta=False, forStorage=False, strKeys=False)
toDict / asDict - Get a dictionary representation of this model.
 
@param includeMeta - Include metadata in return. For now, this is only pk stored as "_id"
 
@param convertValueTypes <bool> - default True. If False, fields with fieldValue defined will be converted to that type.
        Use True when saving, etc, as native type is always either str or bytes.
 
@param strKeys <bool> Default False - If True, just the string value of the field name will be used as the key.
        Otherwise, the IRField itself will be (although represented and indexed by string)
 
@return - Dictionary reprensetation of this object and all fields
cascadeFetch(self)
cascadeFetch - Immediately fetch all foreign links on this field, and all their links, etc.
 
  Normally, this would be done on access of the foreign members, or at .all() time by passing cascadeFetch=True into
   the fetch function
   
   e.x.    MyModel.objects.filter(...).all(cascadeFetch=True)
connect = _deprecated_wrapper(*args, **kwargs)
copy(self, copyPrimaryKey=False, copyValues=False)
copy - Copies this object.
 
@param copyPrimaryKey <bool> default False - If True, any changes to the copy will save over-top the existing entry in Redis.
    If False, only the data is copied, and nothing is saved.
 
@param copyValues <bool> default False - If True, every field value on this object will be explicitly copied. If False,
  an object will be created with the same values, and depending on the type may share the same reference.
  
  This is the difference between a copy and a deepcopy.
 
@return <IndexedRedisModel> - Copy of this object, per above
 
If you need a copy that IS linked, @see IndexedRedisModel.copy
delete(self)
delete - Delete this object
diff(firstObj, otherObj, includeMeta=False)
diff - Compare the field values on two IndexedRedisModels.
 
@param firstObj <IndexedRedisModel instance> - First object (or self)
 
@param otherObj <IndexedRedisModel instance> - Second object
 
@param includeMeta <bool> - If meta information (like pk) should be in the diff results.
 
 
@return <dict> - Dict of  'field' : ( value_firstObjForField, value_otherObjForField ).
        
        Keys are names of fields with different values.
        Value is a tuple of ( value_firstObjForField, value_otherObjForField )
 
Can be called statically, like: IndexedRedisModel.diff ( obj1, obj2 )
 
  or in reference to an obj   : obj1.diff(obj2)
getPk(self)
getPk - Gets the internal primary key associated with this object
getUpdatedFields(self, cascadeObjects=False)
getUpdatedFields - See changed fields.
 
@param cascadeObjects <bool> default False, if True will check if any foreign linked objects themselves have unsaved changes (recursively).
        Otherwise, will just check if the pk has changed.
 
@return - a dictionary of fieldName : tuple(old, new).
 
fieldName may be a string or may implement IRField (which implements string, and can be used just like a string)
hasSameValues(self, other, cascadeObject=True)
hasSameValues - Check if this and another model have the same fields and values.
 
This does NOT include id, so the models can have the same values but be different objects in the database.
 
@param other <IndexedRedisModel> - Another model
 
@param cascadeObject <bool> default True - If True, foreign link values with changes will be considered a difference.
        Otherwise, only the immediate values are checked.
 
@return <bool> - True if all fields have the same value, otherwise False
hasUnsavedChanges(self, cascadeObjects=False)
hasUnsavedChanges - Check if any unsaved changes are present in this model, or if it has never been saved.
 
@param cascadeObjects <bool> default False, if True will check if any foreign linked objects themselves have unsaved changes (recursively).
        Otherwise, will just check if the pk has changed.
 
@return <bool> - True if any fields have changed since last fetch, or if never saved. Otherwise, False
pprint(self, stream=None)
pprint - Pretty-print a dict representation of this object.
 
@param stream <file/None> - Either a stream to output, or None to default to sys.stdout
reload(self, cascadeObjects=True)
reload - Reload this object from the database, overriding any local changes and merging in any updates.
 
 
    @param cascadeObjects <bool> Default True. If True, foreign-linked objects will be reloaded if their values have changed
      since last save/fetch. If False, only if the pk changed will the foreign linked objects be reloaded.
 
    @raises KeyError - if this object has not been saved (no primary key)
 
    @return - Dict with the keys that were updated. Key is field name that was updated,
       and value is tuple of (old value, new value). 
 
    NOTE: Currently, this will cause a fetch of all Foreign Link objects, one level
save(self, cascadeSave=True)
save - Save this object.
 
Will perform an "insert" if this object had not been saved before,
  otherwise will update JUST the fields changed on THIS INSTANCE of the model.
 
  i.e. If you have two processes fetch the same object and change different fields, they will not overwrite
  eachother, but only save the ones each process changed.
 
If you want to save multiple objects of type MyModel in a single transaction,
and you have those objects in a list, myObjs, you can do the following:
 
        MyModel.saver.save(myObjs)
 
@param cascadeSave <bool> Default True - If True, any Foreign models linked as attributes that have been altered
   or created will be saved with this object. If False, only this object (and the reference to an already-saved foreign model) will be saved.
 
@see #IndexedRedisSave.save
 
@return <list> - Single element list, id of saved object (if successful)
saveToExternal(self, redisCon)
saveToExternal - Saves this object to a different Redis than that specified by REDIS_CONNECTION_PARAMS on this model.
 
@param redisCon <dict/redis.Redis> - Either a dict of connection params, a la REDIS_CONNECTION_PARAMS, or an existing Redis connection.
        If you are doing a lot of bulk copies, it is recommended that you create a Redis connection and pass it in rather than establish a new
        connection with each call.
 
@note - You will generate a new primary key relative to the external Redis environment. If you need to reference a "shared" primary key, it is better
                to use an indexed field than the internal pk.
toDict = asDict(self, includeMeta=False, forStorage=False, strKeys=False)

Class methods defined here:
connectAlt(redisConnectionParams) from builtins.type
connectAlt - Create a class of this model which will use an alternate connection than the one specified by REDIS_CONNECTION_PARAMS on this model.
 
@param redisConnectionParams <dict> - Dictionary of arguments to redis.Redis, same as REDIS_CONNECTION_PARAMS.
 
@return - A class that can be used in all the same ways as the existing IndexedRedisModel, but that connects to a different instance.
 
  The fields and key will be the same here, but the connection will be different. use #copyModel if you want an independent class for the model
copyModel() from builtins.type
copyModel - Copy this model, and return that copy.
 
  The copied model will have all the same data, but will have a fresh instance of the FIELDS array and all members,
    and the INDEXED_FIELDS array.
  
  This is useful for converting, like changing field types or whatever, where you can load from one model and save into the other.
 
@return <IndexedRedisModel> - A copy class of this model class with a unique name.
reset(newObjs) from builtins.type
reset - Remove all stored data associated with this model (i.e. all objects of this type),
        and then save all the provided objects in #newObjs , all in one atomic transaction.
 
Use this method to move from one complete set of objects to another, where any querying applications
will only see the complete before or complete after.
 
@param newObjs list<IndexedRedisModel objs> - A list of objects that will replace the current dataset
 
To just replace a specific subset of objects in a single transaction, you can do MyModel.saver.save(objs)
  and just the objs in "objs" will be inserted/updated in one atomic step.
 
This method, on the other hand, will delete all previous objects and add the newly provided objects in a single atomic step,
  and also reset the primary key ID generator
 
@return list<int> - The new primary keys associated with each object (same order as provided #newObjs list)
validateModel() from builtins.type
validateModel - Class method that validates a given model is implemented correctly. Will only be validated once, on first model instantiation.
 
@param model - Implicit of own class
 
@return - True
 
@raises - InvalidModelException if there is a problem with the model, and the message contains relevant information.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
FIELDS = []
INDEXED_FIELDS = []
KEY_NAME = None
REDIS_CONNECTION_PARAMS = {}
__hash__ = None
deleter = <IndexedRedis.IndexedRedisDelete object>
objects = <IndexedRedis.IndexedRedisQuery object>
saver = <IndexedRedis.IndexedRedisSave object>

 
class IndexedRedisQuery(IndexedRedisHelper)
    IndexedRedisQuery - The query object. This is the return of "Model.objects" and "Model.objects.filter*"
 
 
Method resolution order:
IndexedRedisQuery
IndexedRedisHelper
builtins.object

Methods defined here:
__copy__(self)
__deepcopy__ = __copy__(self)
__init__(self, *args, **kwargs)
Internal constructor
 
@param mdl - IndexedRedisModel implementer
all(self, cascadeFetch=False)
all - Get the underlying objects which match the filter criteria.
 
Example:   objs = Model.objects.filter(field1='value', field2='value2').all()
 
@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
   will be fetched immediately. If False, foreign objects will be fetched on-access.
 
@return - Objects of the Model instance associated with this query.
allByAge(self, cascadeFetch=False)
allByAge - Get the underlying objects which match the filter criteria, ordered oldest -> newest
        If you are doing a queue or just need the head/tail, consider .first() and .last() instead.
 
 
@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
   will be fetched immediately. If False, foreign objects will be fetched on-access.
 
@return - Objects of the Model instance associated with this query, sorted oldest->newest
allOnlyFields(self, fields, cascadeFetch=False)
allOnlyFields - Get the objects which match the filter criteria, only fetching given fields.
 
@param fields - List of fields to fetch
 
@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
   will be fetched immediately. If False, foreign objects will be fetched on-access.
 
 
@return - Partial objects with only the given fields fetched
allOnlyIndexedFields(self)
allOnlyIndexedFields - Get the objects which match the filter criteria, only fetching indexed fields.
 
@return - Partial objects with only the indexed fields fetched
compat_convertHashedIndexes(self, fetchAll=True)
compat_convertHashedIndexes - Reindex fields, used for when you change the propery "hashIndex" on one or more fields.
 
For each field, this will delete both the hash and unhashed keys to an object
  and then save a hashed or unhashed value, depending on that field's value for "hashIndex".
 
For an IndexedRedisModel class named "MyModel", call as "MyModel.objects.compat_convertHashedIndexes()"
 
NOTE: This works one object at a time (regardless of #fetchAll), so that an unhashable object does not trash all data.
 
This method is intended to be used while your application is offline,
  as it doesn't make sense to be changing your model while applications are actively using it.
 
@param fetchAll <bool>, Default True - If True, all objects will be fetched first, then converted.
  This is generally what you want to do, as it is more efficient. If you are memory contrainted,
  you can set this to "False", and it will fetch one object at a time, convert it, and save it back.
count(self)
count - gets the number of records matching the filter criteria
 
Example:
        theCount = Model.objects.filter(field1='value').count()
delete(self)
delete - Deletes all entries matching the filter criteria
exists(self, pk)
exists - Tests whether a record holding the given primary key exists.
 
@param pk - Primary key (see getPk method)
 
Example usage: Waiting for an object to be deleted without fetching the object or running a filter. 
 
This is a very cheap operation.
 
@return <bool> - True if object with given pk exists, otherwise False
filter(self, **kwargs)
filter - Add filters based on INDEXED_FIELDS having or not having a value.
  Note, no objects are actually fetched until .all() is called
 
        Use the field name [ model.objects.filter(some_field='value')] to filter on items containing that value.
        Use the field name suffxed with '__ne' for a negation filter [ model.objects.filter(some_field__ne='value') ]
 
Example:
        query = Model.objects.filter(field1='value', field2='othervalue')
 
        objs1 = query.filter(something__ne='value').all()
        objs2 = query.filter(something__ne=7).all()
 
 
@returns - A copy of this object, with the additional filters. If you want to work inline on this object instead, use the filterInline method.
filterInline(self, **kwargs)
filterInline - @see IndexedRedisQuery.filter. This is the same as filter, but works inline on this object instead of creating a copy.
        Use this is you do not need to retain the previous filter object.
first(self, cascadeFetch=False)
First - Returns the oldest record (lowerst primary key) with current filters.
        This makes an efficient queue, as it only fetches a single object.
 
 
@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
   will be fetched immediately. If False, foreign objects will be fetched on-access.
 
@return - Instance of Model object, or None if no items match current filters
get(self, pk, cascadeFetch=False)
get - Get a single value with the internal primary key.
 
 
@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
   will be fetched immediately. If False, foreign objects will be fetched on-access.
 
@param pk - internal primary key (can be found via .getPk() on an item)
getMultiple(self, pks, cascadeFetch=False)
getMultiple - Gets multiple objects with a single atomic operation
 
 
@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
   will be fetched immediately. If False, foreign objects will be fetched on-access.
 
@param pks - list of internal keys
getMultipleOnlyFields(self, pks, fields, cascadeFetch=False)
getMultipleOnlyFields - Gets only certain fields from a list of  primary keys. For working on entire filter set, see allOnlyFields
 
@param pks list<str> - Primary Keys
 
@param fields list<str> - List of fields
 
 
@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
   will be fetched immediately. If False, foreign objects will be fetched on-access.
 
return - List of partial objects with only fields applied
getMultipleOnlyIndexedFields(self, pks)
getMultipleOnlyIndexedFields - Get only the indexed fields on an object. This is the minimum to delete.
 
@param pks - List of primary keys
 
@return - List of objects with only indexed fields fetched
getOnlyFields(self, pk, fields, cascadeFetch=False)
getOnlyFields - Gets only certain fields from a paticular primary key. For working on entire filter set, see allOnlyFields
 
@param pk <int> - Primary Key
 
@param fields list<str> - List of fields
 
@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
   will be fetched immediately. If False, foreign objects will be fetched on-access.
 
 
return - Partial objects with only fields applied
getOnlyIndexedFields(self, pk)
getOnlyIndexedFields - Get only the indexed fields on an object. This is the minimum to delete.
 
@param pk - Primary key
 
@return - Object with only indexed fields fetched.
getPrimaryKeys(self, sortByAge=False)
getPrimaryKeys - Returns all primary keys matching current filterset.
 
@param sortByAge <bool> - If False, return will be a set and may not be ordered.
        If True, return will be a list and is guarenteed to represent objects oldest->newest
 
@return <set> - A set of all primary keys associated with current filters.
last(self, cascadeFetch=False)
Last - Returns the newest record (highest primary key) with current filters.
        This makes an efficient queue, as it only fetches a single object.
 
 
@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
   will be fetched immediately. If False, foreign objects will be fetched on-access.
 
@return - Instance of Model object, or None if no items match current filters
random(self, cascadeFetch=False)
Random - Returns a random record in current filterset.
 
 
@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
   will be fetched immediately. If False, foreign objects will be fetched on-access.
 
@return - Instance of Model object, or None if no items math current filters
reindex(self)
reindex - Reindexes the objects matching current filterset. Use this if you add/remove a field to INDEXED_FIELDS.
 
  NOTE - This will NOT remove entries from the old index if you change index type, or change decimalPlaces on a
    IRFixedPointField.  To correct these indexes, you'll need to run:
 
       Model.reset(Model.objects.all())
 
If you change the value of "hashIndex" on a field, you need to call #compat_convertHashedIndexes instead.

Data descriptors inherited from IndexedRedisHelper:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class IndexedRedisSave(IndexedRedisHelper)
    IndexedRedisSave - Class used to save objects. Used with Model.save is called.
        Except for advanced usage, this is probably for internal only.
 
 
Method resolution order:
IndexedRedisSave
IndexedRedisHelper
builtins.object

Methods defined here:
compat_convertHashedIndexes(self, objs, conn=None)
compat_convertHashedIndexes - Reindex all fields for the provided objects, where the field value is hashed or not.
If the field is unhashable, do not allow.
 
NOTE: This works one object at a time. It is intended to be used while your application is offline,
  as it doesn't make sense to be changing your model while applications are actively using it.
 
@param objs <IndexedRedisModel objects to convert>
@param conn <redis.Redis or None> - Specific Redis connection or None to reuse.
reindex(self, objs, conn=None)
reindex - Reindexes a given list of objects. Probably you want to do Model.objects.reindex() instead of this directly.
 
@param objs list<IndexedRedisModel> - List of objects to reindex
@param conn <redis.Redis or None> - Specific Redis connection or None to reuse
save(self, obj, usePipeline=True, forceID=False, cascadeSave=True, conn=None)
save - Save an object / objects associated with this model. 
 
You probably want to just do object.save() instead of this, but to save multiple objects at once in a single transaction, 
   you can use:
        
        MyModel.saver.save(myObjs)
 
@param obj <IndexedRedisModel or list<IndexedRedisModel> - The object to save, or a list of objects to save
 
@param usePipeline - Use a pipeline for saving. You should always want this, unless you are calling this function from within an existing pipeline.
 
@param forceID - if not False, force ID to this. If obj is list, this is also list. Forcing IDs also forces insert. Up to you to ensure ID will not clash.
@param cascadeSave <bool> Default True - If True, any Foreign models linked as attributes that have been altered
   or created will be saved with this object. If False, only this object (and the reference to an already-saved foreign model) will be saved.
 
@param conn - A connection or None
 
@note - if no ID is specified
 
@return - List of pks
saveMultiple(self, objs)
saveMultiple - Save a list of objects using a pipeline.
 
@param objs < list<IndexedRedisModel> > - List of objects to save

Methods inherited from IndexedRedisHelper:
__copy__(self)
__deepcopy__ = __copy__(self)
__init__(self, mdl)
Internal constructor
 
@param mdl - IndexedRedisModel implementer

Data descriptors inherited from IndexedRedisHelper:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class InvalidModelException(builtins.Exception)
    InvalidModelException - Raised if a model fails validation (not valid)
 
 
Method resolution order:
InvalidModelException
builtins.Exception
builtins.BaseException
builtins.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from builtins.Exception:
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__new__(*args, **kwargs) from builtins.type
Create and return a new object.  See help(type) for accurate signature.

Methods inherited from builtins.BaseException:
__delattr__(self, name, /)
Implement delattr(self, name).
__getattribute__(self, name, /)
Return getattr(self, name).
__reduce__(...)
helper for pickle
__repr__(self, /)
Return repr(self).
__setattr__(self, name, value, /)
Implement setattr(self, name, value).
__setstate__(...)
__str__(self, /)
Return str(self).
with_traceback(...)
Exception.with_traceback(tb) --
set self.__traceback__ to tb and return self.

Data descriptors inherited from builtins.BaseException:
__cause__
exception cause
__context__
exception context
__dict__
__suppress_context__
__traceback__
args

 
Functions
       
getDefaultIREncoding()
getDefaultIREncoding - Get the default encoding that IndexedRedis will use for all field data.
  You can override this on a per-field basis by using an IRField (such as IRUnicodeField or IRRawField)
 
  @return <str> - Default encoding string
getDefaultRedisConnectionParams()
getDefaultRedisConnectionParams - Gets A COPY OF the default Redis connection params.
 
@see setDefaultRedisConnectionParams for more info
 
@return <dict> - copy of default Redis connection parameters
isIndexedRedisModel(model)
setDefaultIREncoding(encoding)
setDefaultIREncoding - Sets the default encoding used by IndexedRedis.
  This will be the default encoding used for field data. You can override this on a
  per-field basis by using an IRField (such as IRUnicodeField or IRRawField)
 
@param encoding - An encoding (like utf-8)
setDefaultRedisConnectionParams(connectionParams)
setDefaultRedisConnectionParams - Sets the default parameters used when connecting to Redis.
 
  This should be the args to redis.Redis in dict (kwargs) form.
 
  @param connectionParams <dict> - A dict of connection parameters.
    Common keys are:
 
       host <str> - hostname/ip of Redis server (default '127.0.0.1')
       port <int> - Port number                 (default 6379)
       db  <int>  - Redis DB number             (default 0)
 
   Omitting any of those keys will ensure the default value listed is used.
 
  This connection info will be used by default for all connections to Redis, unless explicitly set otherwise.
  The common way to override is to define REDIS_CONNECTION_PARAMS on a model, or use AltConnectedModel = MyModel.connectAlt( PARAMS )
 
  Any omitted fields in these connection overrides will inherit the value from the global default.
 
  For example, if your global default connection params define host = 'example.com', port=15000, and db=0, 
    and then one of your models has
       
       REDIS_CONNECTION_PARAMS = { 'db' : 1 }
    
    as an attribute, then that model's connection will inherit host='example.com" and port=15000 but override db and use db=1
 
 
    NOTE: Calling this function will clear the connection_pool attribute of all stored managed connections, disconnect all managed connections,
      and close-out the connection pool.
     It may not be safe to call this function while other threads are potentially hitting Redis (not that it would make sense anyway...)
 
     @see clearRedisPools   for more info
toggleDeprecatedMessages(enabled)
toggleDeprecatedMessages - Normally, a deprecated message will log up to once per message.
  Call toggleDeprecatedMessages(False) to turn them off altogether (like on a Production codebase)
 
@param enabled <bool> - False to disable deprecated messages, otherwise True.

 
Data
        INDEXED_REDIS_PREFIX = '_ir_|'
INDEXED_REDIS_VERSION = (6, 0, 2)
INDEXED_REDIS_VERSION_STR = '6.0.2'
__all__ = ('INDEXED_REDIS_PREFIX', 'INDEXED_REDIS_VERSION', 'INDEXED_REDIS_VERSION_STR', 'IndexedRedisDelete', 'IndexedRedisHelper', 'IndexedRedisModel', 'IndexedRedisQuery', 'IndexedRedisSave', 'isIndexedRedisModel', 'setIndexedRedisEncoding', 'getIndexedRedisEncoding', 'InvalidModelException', 'fields', 'IRField', 'IRFieldChain', 'IRForeignLinkFieldBase', 'irNull', 'setDefaultIREncoding', 'getDefaultIREncoding', 'setDefaultRedisConnectionParams', ...)
irNull = irNull