Friday, May 21, 2021

Re: django utils Integrity error

hanks but ita was already solved

On Wed, 19 May 2021 at 15:52, Antonis Christofides <antonis@antonischristofides.com> wrote:

Could you show the full error message?

Antonis Christofides  +30-6979924665 (mobile)
On 19/05/2021 02.36, Peter Kirieny wrote:
am adding class category in the models.py and adding it as a foreign key in the products model but i get this error while migrating
somebody, please help
here is the code
class Category(models.Model):      name = models.CharField(max_length=50)        def __str__(self):          return self.name      class Product(models.Model):      name = models.CharField(max_length=200)      category = models.ForeignKey(Category, on_delete=models.CASCADE)      price = models.FloatField()      digital = models.BooleanField(default=False, null=True, blank=True)      image = models.ImageField(null=True, blank=True)        def __str__(self):          return self.name
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAL8t8eqJsenwOmJA%3DO_pdcb8Vk4KnjSijoiUNe5H%3DRpPO6%3D32A%40mail.gmail.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a3b0ab19-e675-fdeb-04f2-274f2018988b%40antonischristofides.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAL8t8erV8PfSa6VwWsZyJotcpPeWAwVZAhtU9YY%3DsnJsX%2B-uEA%40mail.gmail.com.

No comments:

Post a Comment