I am still very new to Django and trying to figure out what is the best approach for the following problem.
I want to store user personal preferences (things user likes or dislikes) as simple boolean values - true or false. The thing is that preferences are not fixed and new preferences can be added via admin interface.
This is what I have in mind.
Preferences:
class Preferences(models.Model):
title = models.CharField(max_length=100)
...
Values:
class PreferencesValues(models.Model):
user = models.ForeignKey(User)
preference = models.ForeignKey(Preferences)
value = models.BooleanField()
Is this the way to go or is there some better approach? Also, what would be the best way to make a form that displays all available preferences with checkboxes, but sets initial values to checked for those preferences which user has already marked?