I have a sample form:

```
class AdminDiscountForm(ModelForm):  
    class Meta:  
        model = Discount  
        exclude = ('company',)

```

the model it's pointing to is:

```
class Discount(models.Model):
    class Meta:
        verbose_name=_('Discount')
        verbose_name_plural=_('Discounts')
        unique_together = ('company','type')

    company = models.ForeignKey(Company)
    type = models.CharField(max_length=5, choices=DISCOUNT_CHOICES)
    discount = models.DecimalField(max_digits=7, decimal_places=2, verbose_name=_('Discount'))

```

The form excludes the 'company' field because the user has already selected this using the UI.

i am planning on doing a:

```
company = blah
if form.is_valid():
    obj = form.save(commit=False)
    obj.company = company
    obj.save()

```

The problem is that the combination of 'company' and 'type' should be unique (hence the 'unique\_together'). This is enforced in the database, so django doesn't care.
I need to extend the clean() method of this form to check for uniqueness as such:

```
def clean(self):
    cleaned_data = self.cleaned_data
    # check for uniqueness of 'company' and 'type'

```

The problem here is that 'company' is not in there because it has been excluded.
What is the best way to raise a form validation error in this case?

-- edit
This is only for **adding** discount entries.
There's no initial instance.