Hello,  I have 3 separate app as follow:
from django.db import models

# Create your models here.

# Supplier can have many shipments
class Supplier(models.Model):
name = models.CharField(max_length=120, null=True)
phone = models.CharField(max_length=15, null=True)
email = models.CharField(max_length=120, null=True)
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)

def __str__(self):
return self.name
-----------------------------------------
from django.db import models
from django.utils import timezone

# Create your models here.

# A specie can belong to many shipments
class Specie(models.Model):
name = models.CharField(max_length=120, null=True)
image = models.ImageField(upload_to="species", default="no_picture.png")
created = models.DateTimeField(default=timezone.now)

def __str__(self):
return self.name
--------------------------------------------
from django.db import models
from .models import Supplier

# from .models import Supplier, Specie

# Create your models here.

# A shipment can have many species
class Shipment(models.Model):

supplier = models.ManyToManyField(Suppliers)
specie = models.ManyToManyField(Species)

name = models.CharField(
max_length=120, null=True, help_text="enter name from Supplier above..."
)
slabel = models.CharField(max_length=10)
received = models.PositiveIntegerField(default=0)
bad = models.PositiveIntegerField(default=0)
non = models.PositiveIntegerField(default=0)
doa = models.PositiveIntegerField(default=0)
para = models.PositiveIntegerField(default=0)
released = models.PositiveIntegerField(default=0)
entered = models.BooleanField(default=False)
created = models.DateTimeField(default=timezone.now)

def __str__(self):
return f"{self.slabel}"

=======================

when trying to migrate I get this error message:

ImportError: cannot import name 'Supplier' from partially initialized 
module 'shipments.models' (most likely due to a circular import) 
(/Users/frankd/django_projects/stlzoo/src/shipments/models.py)

I am stuck here and cannot seem to resolve this error.  I would truly 
appreciate any help on this.  Thanks.

Frank

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c0aff4c4-651a-43ad-9ac9-42c6452a33f4n%40googlegroups.com.

Reply via email to