>>Implement everything using ForeignKey
for multiple select, you need a ManyToManyField
\r
KITCHEN_OPTIONS = (
(1, 'kitchen'),
(2, 'Kitchen'),
(3, 'Kitchen'),
(4, 'Kitchen island'),
(5, 'Outdoor kitchen'),
)
\r
class KitchenChoices(models.Model):
options = models.CharField(max_length=100, blank = True, choices=KITCHEN_OPTIONS)
\r
class Apartment(models.Model):
kitchen_type = models.ManyToManyField(KitchenChoices)
...
\r
in template this field is display automatically and to make iteration over options and build checkboxes with appropriate Labelle, and value...
\r
question, do you need to save the form from the frontend, or just do a search for fields... hence the options branch...
if save is not necessary, then the admin will get a multiple select to save the options... if you need something
when you save the form
\r
class Apartment(models.Model):
kitchen = models.CharField(max_length=100, blank = True, choices=KITCHEN_OPTIONS)
...
\r
in template this field is display automatically and to do iteration