Best way to save availability of user over days of week in python/django
I'd go for separate boolean columns.
It'll be a lot easier for you to then query, say, for users that are available on mondays; or to count the number of users that available through every weekday, or whatever.
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)