django - How can i store user preferences as a dictionary to a user profile? -
i have list of categories, each of has metacategory. create select multiple fields allow user filter objects wants see. gives me dictionary this:
filter={'genres':[id1,id2...],'parts':[id9,id11...],...}
now want store user profile, user gets last search results when returning page.
i know m2m field, involve recreate filer dictionary, prefer store dictionary. bad idea? why? if not, way it?
as mentioned pickling 1 option. choose jsonfield (you can find them google) format more readable can nicer debugging.
it's worth pointing out it's hard query models based on data stored in dictionaries. looks won't issue though.
Comments
Post a Comment