Best way to save availability of user over days of week in python/django
One other option is the more-or-less obvious one: define a table of the days of the week, and have a ManyToManyField map one to the other. The admin would just work, you can do searches based on dates, and it works on SQLite unlike some of the functions in django-bitfield. Searches can be fast, since they're within the database and you don't have to use SQL's LIKE (which ignores indexes if there are wildcards at the start of the string, which would be the case for CommaSeparatedIntegerField or a seven-character string).
Sure, it takes more storage, but how many users do you have, anyway?  Millions?
P.S. if you have an ordering field in your weekday table, you can also make the database sort by day of week for you with something like queryset.order_by('available__order').
I want to store users preferences for day(s) of week he might be available. e.g. A user can be available on saturday, sunday but not on other days.
Currently I am using array of 7 checkboxes(values=1,2,...7) so that user can select individual days of his availability.
Now the first question is how can i store this in database. I am thinking of using a string(length=7) and storing preferences like 1100010 where 1 will signify available and 0 not available. Is it good practice?
Second question, how can I convert POST data (["1","2","7"]) into string (1100010)