You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -94,6 +94,9 @@ This is the model you should extend.
94
94
95
95
**Deprecated Fields:**
96
96
97
+
The following class-level items have been deprecated in 4.0 and may be removed in a future version of IndexedRedis.
98
+
99
+
97
100
*BINARY_FIELDS* - A list of strings containing the names of fields which will be stored directly as unencoded bytes. This is generally faster and more space-efficient than using BASE64\_FIELDS, and should be used for purely binary data.
98
101
99
102
Example: ['picture', 'mp3_data']
@@ -166,6 +169,8 @@ e.x.
166
169
167
170
An entry in "FIELDS" that is just a string name ( pre 4.0 style ) will be treated same as IRField('myname', valueType=str), and behaves exactly the same, so models are backwards-compatible.
168
171
172
+
These objects (all importable from IndexedRedis.fields) can all be put in the FIELDS array.
173
+
169
174
170
175
*IRField* - Standard field, takes a name and a "valueType", which is a native python type, or any type you create which implements \_\_new\_\_, taking a signle argument and returning the object. See IndexedRedis/fields/FieldValueTypes for example of how datetime and json are implemented.
171
176
@@ -188,6 +193,26 @@ When no valueType is defined, str/unicode is the type (same as pre-4.0), and def
188
193
*IRRawField* - Field that is not converted in any, to or from Redis. On fetch this will always be "bytes" type (or str in python2). On python3 this is very similar to IRField(...valueType=None), but python2 needs this to store binary data without running into encoding issues.
189
194
190
195
196
+
**Chaining Multiple Types**
197
+
198
+
You can chain multiple types together using IRFieldChain. Instead of specifying the name on the IRField (or subclass), you specify the name on the IRFieldChain, and list all the types as the second argument (chainedFields). For storage, all operations will be applied left-to-right, and upon fetch the object will be decoded right-to-left.
Copy file name to clipboardExpand all lines: README.rst
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -109,6 +109,9 @@ This is the model you should extend.
109
109
110
110
**Deprecated Fields:**
111
111
112
+
The following class-level items have been deprecated in 4.0 and may be removed in a future version of IndexedRedis.
113
+
114
+
112
115
*BINARY_FIELDS* - A list of strings containing the names of fields which will be stored directly as unencoded bytes. This is generally faster and more space-efficient than using BASE64\_FIELDS, and should be used for purely binary data.
113
116
114
117
Example: ['picture', 'mp3_data']
@@ -181,6 +184,8 @@ e.x.
181
184
182
185
An entry in "FIELDS" that is just a string name ( pre 4.0 style ) will be treated same as IRField('myname', valueType=str), and behaves exactly the same, so models are backwards-compatible.
183
186
187
+
These objects (all importable from IndexedRedis.fields) can all be put in the FIELDS array.
188
+
184
189
185
190
*IRField* - Standard field, takes a name and a "valueType", which is a native python type, or any type you create which implements \_\_new\_\_, taking a signle argument and returning the object. See IndexedRedis/fields/FieldValueTypes for example of how datetime and json are implemented.
186
191
@@ -203,6 +208,27 @@ When no valueType is defined, str/unicode is the type (same as pre-4.0), and def
203
208
*IRRawField* - Field that is not converted in any, to or from Redis. On fetch this will always be "bytes" type (or str in python2). On python3 this is very similar to IRField(...valueType=None), but python2 needs this to store binary data without running into encoding issues.
204
209
205
210
211
+
**Chaining Multiple Types**
212
+
213
+
You can chain multiple types together using IRFieldChain. Instead of specifying the name on the IRField (or subclass), you specify the name on the IRFieldChain, and list all the types as the second argument (chainedFields). For storage, all operations will be applied left-to-right, and upon fetch the object will be decoded right-to-left.
0 commit comments