Question: I am new to Django and am having issues with the forms.py. I am pulling values from a database via Models.Py and then using those objects as a dropdown list on my Django page.

For example, I have Car Data stored in a database:

Honda | Accord | Black | 2016

Toyota | Camry | Red | 2014

Ford | Fusion | White | 2018

Honda | Civic | Silver | 2020

Toyota | Corolla | Black | 2010

And so on. In models.py, I have:

```
class MyCars(models.Model):

    make_name = models.CharField(max_length=50, blank=True, null=True)
    model_name = models.CharField(max_length=50, blank=True, null=True)
    color = models.CharField(max_length=15, blank=True, null=True)
    year = models.CharField(max_length=15, blank=True, null=True)

    def __str__(self):
        all_cars = []
        return self.make_name

    class Meta:
        managed = False
        db_table = 'my_cars'

```

Then in my form.py I do something along the line of:

```
all_cars = forms.ModelChoiceField(queryset=MyCars.objects.all())

```

The problem is I will then have duplicate values for Honda, Toyota etc, when I only need Honda to appear once on the dropdown. Any suggestions/ideas to filter through this?

Answer: 
It looks like you face the problem of your tables not being normalized. Considering that many cars may have the same make and there may be new makes over time you really should have a **Model** for make and have a foreign key from `MyCars` to `Make`.

```
class Make(models.Model):
    name = models.CharField(max_length=50, blank=True, null=True)

    def __str__(self):
        return self.name

class MyCars(models.Model):
    make = models.ForeignKey(Make, on_delete=models.CASCADE, related_name="cars")
    model_name = models.CharField(max_length=50, blank=True, null=True)
    color = models.CharField(max_length=15, blank=True, null=True)
    year = models.CharField(max_length=15, blank=True, null=True)

    def __str__(self):
        all_cars = []
        return self.make_name

    class Meta:
        managed = False
        db_table = 'my_cars'

```

Now in your form:

```
all_cars = forms.ModelChoiceField(queryset=Make.objects.all())

```

Also the name `MyCars` should be singular(`MyCar`) as model names are meant to be singular (check `verbose_name` and `verbose_name_plural` in your case `verbose_name_plural` ends up to be `my carss`).
You are not having duplicates, you problem is that your **str** function returns the self.make\_name, so, your queryset is the full list of cars, and as the Toyota Camry, and Toyota Corolla have the same make\_name you see them with the same name, but in the back side you are just showing that attribute. You can use the distinct function over your query to change the attribute, or you can directly change the **str** function over your car model to adapt to what you need (you can concatenate multiple attributes). Here an example:

```
def __str__(self):
    all_cars = []
    return f"${self.make_name} - {self.model_name}"

```