Skip to content

Commit

Permalink
Update pydoc
Browse files Browse the repository at this point in the history
  • Loading branch information
kata198 committed May 1, 2017
1 parent 52b9018 commit 8fa513a
Showing 1 changed file with 20 additions and 154 deletions.
174 changes: 20 additions & 154 deletions doc/IndexedRedis.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<table width="100%" cellspacing="0" cellpadding="2" border="0" summary="heading" >
<tr bgcolor="#7799ee" >
<td valign="bottom" >&nbsp;<br />
<font color="#ffffff" face="helvetica, arial" >&nbsp;<br /><big ><big ><strong >IndexedRedis</strong></big></big> (version 5.0.0)</font></td><td align="right" valign="bottom" ><font color="#ffffff" face="helvetica, arial" ><a href="IndexedRedis.html" >index</a></font></td></tr></table>
<font color="#ffffff" face="helvetica, arial" >&nbsp;<br /><big ><big ><strong >IndexedRedis</strong></big></big> (version 5.0.1)</font></td><td align="right" valign="bottom" ><font color="#ffffff" face="helvetica, arial" ><a href="IndexedRedis.html" >index</a></font></td></tr></table>
<p ><tt >#&nbsp;Copyright&nbsp;(c)&nbsp;2014,&nbsp;2015,&nbsp;2016,&nbsp;2017&nbsp;Timothy&nbsp;Savannah&nbsp;under&nbsp;LGPL&nbsp;version&nbsp;2.1.&nbsp;See&nbsp;LICENSE&nbsp;for&nbsp;more&nbsp;information.<br />
#&nbsp;&nbsp;IndexedRedis&nbsp;A&nbsp;redis-backed&nbsp;very&nbsp;very&nbsp;fast&nbsp;ORM-style&nbsp;framework&nbsp;that&nbsp;supports&nbsp;indexes,&nbsp;and&nbsp;searches&nbsp;with&nbsp;O(1)&nbsp;efficency.<br />
#&nbsp;&nbsp;&nbsp;&nbsp;It&nbsp;has&nbsp;syntax&nbsp;similar&nbsp;to&nbsp;Django&nbsp;and&nbsp;Flask&nbsp;and&nbsp;other&nbsp;ORMs,&nbsp;but&nbsp;is&nbsp;itself&nbsp;unique&nbsp;in&nbsp;many&nbsp;ways.</tt></p>
Expand Down Expand Up @@ -1014,172 +1014,38 @@
<tr bgcolor="#ffc8d8" ><td rowspan="2" ><tt >&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan="2" ><tt ><a href="#IndexedRedisModel" >IndexedRedisModel</a>&nbsp;-&nbsp;This&nbsp;is&nbsp;the&nbsp;model&nbsp;you&nbsp;should&nbsp;extend.<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;See:&nbsp;https://github.com/kata198/indexedredis/blob/master/README.md&nbsp;for&nbsp;documentation<br />
&nbsp;<br />
&nbsp;**Required&nbsp;Fields:**<br />
&nbsp;<br />
&nbsp;*FIELDS*&nbsp;-&nbsp;REQUIRED.&nbsp;a&nbsp;list&nbsp;of&nbsp;strings&nbsp;which&nbsp;name&nbsp;the&nbsp;fields&nbsp;that&nbsp;can&nbsp;be&nbsp;used&nbsp;for&nbsp;storage.&nbsp;Can&nbsp;also&nbsp;be&nbsp;<a href="#IRField" >IRField</a>&nbsp;or&nbsp;an&nbsp;implementing&nbsp;type&nbsp;(see&nbsp;AdvancedFields&nbsp;below)<br />
&nbsp;**Attributes**<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example:&nbsp;['Name',&nbsp;'Description',&nbsp;'Model',&nbsp;'Price']<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FIELDS&nbsp;-&nbsp;An&nbsp;array&nbsp;of&nbsp;<a href="#IRField" >IRField</a>&nbsp;objects,&nbsp;which&nbsp;define&nbsp;the&nbsp;fields&nbsp;on&nbsp;this&nbsp;model.<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INDEXED_FIELDS&nbsp;-&nbsp;The&nbsp;field&nbsp;names&nbsp;on&nbsp;which&nbsp;to&nbsp;index<br />
&nbsp;<br />
&nbsp;*INDEXED_FIELDS*&nbsp;-&nbsp;&nbsp;a&nbsp;list&nbsp;of&nbsp;strings&nbsp;containing&nbsp;the&nbsp;names&nbsp;of&nbsp;fields&nbsp;that&nbsp;will&nbsp;be&nbsp;indexed.&nbsp;Can&nbsp;only&nbsp;filter&nbsp;on&nbsp;indexed&nbsp;fields.&nbsp;Adds&nbsp;insert/delete&nbsp;time.&nbsp;Contents&nbsp;must&nbsp;also&nbsp;be&nbsp;in&nbsp;FIELDS.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;KEY_NAME&nbsp;-&nbsp;A&nbsp;string&nbsp;of&nbsp;the&nbsp;"key"&nbsp;name&nbsp;which&nbsp;will&nbsp;be&nbsp;used&nbsp;for&nbsp;this&nbsp;model<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example:&nbsp;['Name',&nbsp;'Model']<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;REDIS_CONNECTION_PARAMS&nbsp;-&nbsp;A&nbsp;dict&nbsp;which&nbsp;provides&nbsp;fields&nbsp;to&nbsp;override&nbsp;over&nbsp;the&nbsp;inherited&nbsp;default&nbsp;Redis&nbsp;connection<br />
&nbsp;<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;**Basic&nbsp;Usage**<br />
&nbsp;<br />
&nbsp;*KEY_NAME*&nbsp;-&nbsp;REQUIRED.&nbsp;A&nbsp;unique&nbsp;name&nbsp;name&nbsp;that&nbsp;represents&nbsp;this&nbsp;model.&nbsp;Think&nbsp;of&nbsp;it&nbsp;like&nbsp;a&nbsp;table&nbsp;name.&nbsp;<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example:&nbsp;'Items'<br />
&nbsp;<br />
&nbsp;*REDIS_CONNECTION_PARAMS*&nbsp;-&nbsp;provides&nbsp;the&nbsp;arguments&nbsp;to&nbsp;pass&nbsp;into&nbsp;"redis.Redis",&nbsp;to&nbsp;construct&nbsp;a&nbsp;redis&nbsp;<a href="builtins.html#object" >object</a>.<br />
&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;If&nbsp;not&nbsp;defined&nbsp;or&nbsp;empty,&nbsp;the&nbsp;default&nbsp;params&nbsp;will&nbsp;be&nbsp;used.<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;set/get&nbsp;the&nbsp;default&nbsp;via&nbsp;setDefaultRedisConnectionParams&nbsp;and&nbsp;getDefaultRedisConnectionParams<br />
&nbsp;<br />
&nbsp;Usage<br />
&nbsp;-----<br />
&nbsp;<br />
&nbsp;Usage&nbsp;is&nbsp;very&nbsp;similar&nbsp;to&nbsp;Django&nbsp;or&nbsp;Flask.<br />
&nbsp;<br />
&nbsp;**Query:**<br />
&nbsp;<br />
&nbsp;Calling&nbsp;.filter&nbsp;or&nbsp;.filterInline&nbsp;builds&nbsp;a&nbsp;query/filter&nbsp;set.&nbsp;Use&nbsp;one&nbsp;of&nbsp;the&nbsp;*Fetch*&nbsp;methods&nbsp;described&nbsp;below&nbsp;to&nbsp;execute&nbsp;a&nbsp;query.<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objects&nbsp;=&nbsp;SomeModel.objects.filter(param1=val).filter(param2=val).all()<br />
&nbsp;<br />
&nbsp;**Save:**<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;obj&nbsp;=&nbsp;SomeModel(field1='value',&nbsp;field2='value')<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;obj.<a href="#IndexedRedisModel-save" >save</a>()<br />
&nbsp;<br />
&nbsp;**Delete&nbsp;Using&nbsp;Filters:**<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SomeModel.objects.filter(name='Bad&nbsp;Man').<a href="#IndexedRedisModel-delete" >delete</a>()<br />
&nbsp;<br />
&nbsp;**Delete&nbsp;Individual&nbsp;Objects:**<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;obj.<a href="#IndexedRedisModel-delete" >delete</a>()<br />
&nbsp;<br />
&nbsp;**Atomic&nbsp;Dataset&nbsp;Replacement:**<br />
&nbsp;<br />
&nbsp;There&nbsp;is&nbsp;also&nbsp;a&nbsp;powerful&nbsp;method&nbsp;called&nbsp;"reset"&nbsp;which&nbsp;will&nbsp;**atomically**&nbsp;replace&nbsp;all&nbsp;elements&nbsp;belonging&nbsp;to&nbsp;a&nbsp;model.&nbsp;This&nbsp;is&nbsp;useful&nbsp;for&nbsp;cache-replacement,&nbsp;etc.<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lst&nbsp;=&nbsp;[SomeModel(...),&nbsp;SomeModel(..)]<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SomeModel.<a href="#IndexedRedisModel-reset" >reset</a>(lst)<br />
&nbsp;<br />
&nbsp;For&nbsp;example,&nbsp;you&nbsp;could&nbsp;have&nbsp;a&nbsp;SQL&nbsp;backend&nbsp;and&nbsp;a&nbsp;cron&nbsp;job&nbsp;that&nbsp;does&nbsp;complex&nbsp;queries&nbsp;(or&nbsp;just&nbsp;fetches&nbsp;the&nbsp;same&nbsp;models)&nbsp;and&nbsp;does&nbsp;an&nbsp;atomic&nbsp;replace&nbsp;every&nbsp;5&nbsp;minutes&nbsp;to&nbsp;get&nbsp;massive&nbsp;performance&nbsp;boosts&nbsp;in&nbsp;your&nbsp;application.<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;Filter&nbsp;objects&nbsp;by&nbsp;SomeModel.objects.filter(key=val,&nbsp;key2=val2)&nbsp;and&nbsp;get&nbsp;objects&nbsp;with&nbsp;.all<br />
&nbsp;<br />
&nbsp;Example:&nbsp;SomeModel.objects.filter(name='Tim',&nbsp;colour='purple').filter(number=5).all()<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;**Fetch&nbsp;Functions**:<br />
&nbsp;<br />
&nbsp;Building&nbsp;filtersets&nbsp;do&nbsp;not&nbsp;actually&nbsp;fetch&nbsp;any&nbsp;data&nbsp;until&nbsp;one&nbsp;of&nbsp;these&nbsp;are&nbsp;called&nbsp;(see&nbsp;API&nbsp;for&nbsp;a&nbsp;complete&nbsp;list).&nbsp;All&nbsp;of&nbsp;these&nbsp;functions&nbsp;act&nbsp;on&nbsp;current&nbsp;filterset.<br />
&nbsp;<br />
&nbsp;Example:&nbsp;matchingObjects&nbsp;=&nbsp;SomeModel.objects.filter(...).all()<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;all&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;Return&nbsp;all&nbsp;objects&nbsp;matching&nbsp;this&nbsp;filter<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;allOnlyFields&nbsp;-&nbsp;Takes&nbsp;a&nbsp;list&nbsp;of&nbsp;fields&nbsp;and&nbsp;only&nbsp;fetches&nbsp;those&nbsp;fields,&nbsp;using&nbsp;current&nbsp;filterset<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delete&nbsp;-&nbsp;Delete&nbsp;objects&nbsp;matching&nbsp;this&nbsp;filter<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count&nbsp;&nbsp;-&nbsp;Get&nbsp;the&nbsp;count&nbsp;of&nbsp;objects&nbsp;matching&nbsp;this&nbsp;filter<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;first&nbsp;&nbsp;-&nbsp;Get&nbsp;the&nbsp;oldest&nbsp;record&nbsp;with&nbsp;current&nbsp;filters<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;last&nbsp;&nbsp;&nbsp;-&nbsp;Get&nbsp;the&nbsp;newest&nbsp;record&nbsp;with&nbsp;current&nbsp;filters<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;random&nbsp;-&nbsp;Get&nbsp;a&nbsp;random&nbsp;element&nbsp;with&nbsp;current&nbsp;filters<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getPrimaryKeys&nbsp;-&nbsp;Gets&nbsp;primary&nbsp;keys&nbsp;associated&nbsp;with&nbsp;current&nbsp;filters<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;**Filter&nbsp;Functions**<br />
&nbsp;<br />
&nbsp;These&nbsp;functions&nbsp;add&nbsp;filters&nbsp;to&nbsp;the&nbsp;current&nbsp;set.&nbsp;"filter"&nbsp;returns&nbsp;a&nbsp;copy,&nbsp;"filterInline"&nbsp;acts&nbsp;on&nbsp;that&nbsp;<a href="builtins.html#object" >object</a>.<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;filter&nbsp;-&nbsp;Add&nbsp;additional&nbsp;filters,&nbsp;returning&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;filter&nbsp;<a href="builtins.html#object" >object</a>&nbsp;(moreFiltered&nbsp;=&nbsp;filtered.filter(key2=val2))<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;filterInline&nbsp;-&nbsp;Add&nbsp;additional&nbsp;filters&nbsp;to&nbsp;current&nbsp;filter&nbsp;<a href="builtins.html#object" >object</a>.&nbsp;<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;**Global&nbsp;Fetch&nbsp;functions**<br />
&nbsp;<br />
&nbsp;These&nbsp;functions&nbsp;are&nbsp;available&nbsp;on&nbsp;SomeModel.objects&nbsp;and&nbsp;don't&nbsp;use&nbsp;any&nbsp;filters&nbsp;(they&nbsp;get&nbsp;specific&nbsp;objects):<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get&nbsp;-&nbsp;Get&nbsp;a&nbsp;single&nbsp;<a href="builtins.html#object" >object</a>&nbsp;by&nbsp;pk<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getMultiple&nbsp;-&nbsp;Get&nbsp;multiple&nbsp;objects&nbsp;by&nbsp;a&nbsp;list&nbsp;of&nbsp;pks<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;**Model&nbsp;Functions**<br />
&nbsp;<br />
&nbsp;Actual&nbsp;objects&nbsp;contain&nbsp;methods&nbsp;including:<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;save&nbsp;&nbsp;&nbsp;-&nbsp;Save&nbsp;this&nbsp;<a href="builtins.html#object" >object</a>&nbsp;(create&nbsp;if&nbsp;not&nbsp;exist,&nbsp;otherwise&nbsp;update)<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delete&nbsp;-&nbsp;Delete&nbsp;this&nbsp;<a href="builtins.html#object" >object</a><br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getUpdatedFields&nbsp;-&nbsp;See&nbsp;changes&nbsp;since&nbsp;last&nbsp;fetch<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;Advanced&nbsp;Fields<br />
&nbsp;---------------<br />
&nbsp;<br />
&nbsp;IndexedRedis&nbsp;since&nbsp;version&nbsp;4.0&nbsp;allows&nbsp;you&nbsp;to&nbsp;pass&nbsp;elements&nbsp;of&nbsp;type&nbsp;<a href="#IRField" >IRField</a>&nbsp;(extends&nbsp;<a href="builtins.html#str" >str</a>)&nbsp;in&nbsp;the&nbsp;FIELDS&nbsp;element.<br />
&nbsp;<br />
&nbsp;Doing&nbsp;so&nbsp;allows&nbsp;you&nbsp;to&nbsp;specify&nbsp;certain&nbsp;properties&nbsp;about&nbsp;the&nbsp;field.<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;Example:<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FIELDS&nbsp;=&nbsp;[&nbsp;'name',&nbsp;<a href="#IRField" >IRField</a>('age',&nbsp;valueType=int),&nbsp;'birthday'&nbsp;]<br />
&nbsp;<br />
**Field&nbsp;Name**<br />
&nbsp;<br />
The&nbsp;first&nbsp;argument&nbsp;is&nbsp;the&nbsp;string&nbsp;of&nbsp;the&nbsp;field&nbsp;name.<br />
&nbsp;<br />
&nbsp;**Type**<br />
&nbsp;<br />
&nbsp;You&nbsp;can&nbsp;have&nbsp;a&nbsp;value&nbsp;automatically&nbsp;cast&nbsp;to&nbsp;a&nbsp;certain&nbsp;type&nbsp;(which&nbsp;saves&nbsp;a&nbsp;step&nbsp;if&nbsp;you&nbsp;need&nbsp;to&nbsp;filter&nbsp;further&nbsp;through&nbsp;the&nbsp;QueryableList&nbsp;results,&nbsp;like&nbsp;age__gt=15)<br />
&nbsp;<br />
&nbsp;by&nbsp;passing&nbsp;that&nbsp;type&nbsp;as&nbsp;"valueType".&nbsp;(e.x.&nbsp;&nbsp;<a href="#IRField" >IRField</a>('age',&nbsp;valueType=int))<br />
&nbsp;<br />
&nbsp;If&nbsp;you&nbsp;use&nbsp;"bool",&nbsp;the&nbsp;values&nbsp;0&nbsp;and&nbsp;case&nbsp;insensitive&nbsp;string&nbsp;'false'&nbsp;will&nbsp;result&nbsp;in&nbsp;False,&nbsp;and&nbsp;1&nbsp;or&nbsp;'true'&nbsp;will&nbsp;result&nbsp;in&nbsp;True.<br />
&nbsp;<br />
&nbsp;Be&nbsp;careful&nbsp;using&nbsp;floats,&nbsp;different&nbsp;hosts&nbsp;will&nbsp;have&nbsp;different&nbsp;floating&nbsp;point&nbsp;representations&nbsp;for&nbsp;the&nbsp;same&nbsp;value.&nbsp;Don't&nbsp;expect<br />
&nbsp;<br />
&nbsp;floats&nbsp;to&nbsp;work&nbsp;cross-platform.&nbsp;Use&nbsp;a&nbsp;fixed&nbsp;point&nbsp;number&nbsp;as&nbsp;the&nbsp;string&nbsp;type&nbsp;(&nbsp;like&nbsp;myFixedPoint&nbsp;=&nbsp;'%2.5f'&nbsp;%(&nbsp;10.12345&nbsp;)&nbsp;)<br />
&nbsp;<br />
&nbsp;**&nbsp;Null&nbsp;Values&nbsp;**<br />
&nbsp;<br />
&nbsp;For&nbsp;any&nbsp;type&nbsp;except&nbsp;strings&nbsp;(including&nbsp;the&nbsp;default&nbsp;type,&nbsp;string),&nbsp;a&nbsp;null&nbsp;value&nbsp;is&nbsp;assigned&nbsp;irNull&nbsp;(of&nbsp;type&nbsp;IRNullType).<br />
&nbsp;<br />
&nbsp;irNull&nbsp;does&nbsp;not&nbsp;equal&nbsp;empty&nbsp;string,&nbsp;or&nbsp;anything&nbsp;except&nbsp;another&nbsp;irNull.&nbsp;This&nbsp;is&nbsp;to&nbsp;destinguish&nbsp;say,&nbsp;no&nbsp;int&nbsp;assigned&nbsp;vs&nbsp;int(0)<br />
&nbsp;<br />
&nbsp;You&nbsp;can&nbsp;check&nbsp;a&nbsp;typed&nbsp;field&nbsp;against&nbsp;the&nbsp;"irNull"&nbsp;variable&nbsp;found&nbsp;in&nbsp;the&nbsp;IndexedRedis&nbsp;or&nbsp;IndexedRedis.fields.<br />
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;basic&nbsp;model&nbsp;for&nbsp;usage&nbsp;is,<br />
&nbsp;<br />
&nbsp;from&nbsp;IndexedRedis&nbsp;import&nbsp;irNull<br />
&nbsp;..<br />
&nbsp;e.x.&nbsp;notDangerFive&nbsp;=&nbsp;myResults.filter(dangerLevel__ne=irNull).filter(dangerLevel__ne=5)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Filtering<br />
&nbsp;<br />
&nbsp;or&nbsp;even<br />
&nbsp;&nbsp;&nbsp;&nbsp;MyModel.objects.filter(field1='value1',&nbsp;field2__ne='notvalue2').all()&nbsp;&nbsp;&nbsp;#&nbsp;Fetch&nbsp;all&nbsp;objects&nbsp;where&nbsp;field1&nbsp;is&nbsp;"value1"&nbsp;and&nbsp;field2&nbsp;is&nbsp;not&nbsp;"notvalue2"<br />
&nbsp;<br />
&nbsp;notDangerFive&nbsp;=&nbsp;MyModel.objects.filter(dangerLevel__ne=irNull).filter(dangerLevel__ne=5).all()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Creating&nbsp;/&nbsp;Saving&nbsp;<a href="builtins.html#object" >object</a><br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;myObj&nbsp;=&nbsp;MyModel()<br />
&nbsp;<br />
&nbsp;Encodings<br />
&nbsp;---------<br />
&nbsp;&nbsp;&nbsp;&nbsp;myObj.field1&nbsp;=&nbsp;'value1'<br />
&nbsp;<br />
&nbsp;IndexedRedis&nbsp;will&nbsp;use&nbsp;by&nbsp;default&nbsp;your&nbsp;system&nbsp;default&nbsp;encoding&nbsp;(sys.getdefaultencoding),&nbsp;unless&nbsp;it&nbsp;is&nbsp;ascii&nbsp;(python2)&nbsp;in&nbsp;which&nbsp;case&nbsp;it&nbsp;will&nbsp;default&nbsp;to&nbsp;utf-8.<br />
&nbsp;&nbsp;&nbsp;&nbsp;myObj.<a href="#IndexedRedisModel-save" >save</a>()<br />
&nbsp;<br />
&nbsp;You&nbsp;may&nbsp;change&nbsp;this&nbsp;via&nbsp;IndexedRedis.setDefaultIREncoding<br />&nbsp;</tt></td></tr>
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;There&nbsp;are&nbsp;many&nbsp;more&nbsp;methods&nbsp;and&nbsp;usage,&nbsp;etc,&nbsp;see&nbsp;pydoc&nbsp;or&nbsp;README&nbsp;for&nbsp;more&nbsp;information.<br />&nbsp;</tt></td></tr>
<tr ><td >&nbsp;</td>
<td width="100%" >Methods defined here:<br />
<dl ><dt ><a name="IndexedRedisModel-__copy__" ><strong >__copy__</strong></a>(self)</dt><dd ><tt >&nbsp;__copy__&nbsp;-&nbsp;Used&nbsp;by&nbsp;the&nbsp;"copy"&nbsp;module&nbsp;to&nbsp;make&nbsp;a&nbsp;copy,<br />
Expand Down Expand Up @@ -1758,8 +1624,8 @@

<tr ><td bgcolor="#55aa55" ><tt >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td >&nbsp;</td>
<td width="100%" ><strong >INDEXED_REDIS_PREFIX</strong> = '_ir_|'<br />
<strong >INDEXED_REDIS_VERSION</strong> = (5, 0, 0)<br />
<strong >INDEXED_REDIS_VERSION_STR</strong> = '5.0.0'<br />
<strong >INDEXED_REDIS_VERSION</strong> = (5, 0, 1)<br />
<strong >INDEXED_REDIS_VERSION_STR</strong> = '5.0.1'<br />
<strong >__all__</strong> = ('INDEXED_REDIS_PREFIX', 'INDEXED_REDIS_VERSION', 'INDEXED_REDIS_VERSION_STR', 'IndexedRedisDelete', 'IndexedRedisHelper', 'IndexedRedisModel', 'IndexedRedisQuery', 'IndexedRedisSave', 'isIndexedRedisModel', 'setIndexedRedisEncoding', 'getIndexedRedisEncoding', 'InvalidModelException', 'fields', 'IRField', 'IRFieldChain', 'irNull', 'setDefaultIREncoding', 'getDefaultIREncoding', 'setDefaultRedisConnectionParams', 'getDefaultRedisConnectionParams', ...)<br />
<strong >irNull</strong> = irNull</td></tr></table>
</p></p></p></p></body></html>

0 comments on commit 8fa513a

Please sign in to comment.