how to model bitarrays in django?
What would be the best way to store a large bitarray within a django model (mysql backend)?
for example, how could i store this object:
import bitarray开发者_Go百科
bits = bitarray.bitarray('11000101010') #real data is 35k bits long
Should i just shove it in a CharField?
MySQL has a BLOB field type that's worth considering.
Or you could converting it to a hex string, prefixed with the length, which would take up less than 9KB:
"11,C54"
Or ASCII-85, which would take up less space than hex.
精彩评论