Hello,
I have the following class:

==================================
class Silo(models.Model):
    nave = models.ForeignKey(Nave, on_delete=models.CASCADE)
    codSil = models.CharField(
        'Código Silo', db_index=True, max_length=2, default='01')
    notas = models.TextField(null=True, blank=True)

    def __str__(self):
        return "%s %s" % (self.nave, self.codSil)

        class Meta:
            order_with_respect_to = 'nave'
            unique_together = ('nave', 'codSil')
====================================

But the option unique_together does not work because duplicate values 
​​exist in the SQLite database for nave and codSil.

To solve it, I have to create the index nave + codSil by hand in the SQLite 
database ???

Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/555b1903-b6f5-4af1-b7a2-a7921d1fdbac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to