पर विचार करें निम्नलिखित (सरलीकृत) Django मॉडल है कई:कई संबंध है जो स्थापित नहीं किया गया है या तो या अमूर्त
class productFamily(models.Model):
name = models.CharField(max_length = 256)
text = models.TextField(blank = False)
image = models.ImageField(upload_to="products/img/")
def __unicode__(self):
return self.name
class productModel(models.Model):
productFamily = models.ForeignKey('productFamily')
productFamily.help_text = 'ProductFamily to which this model belongs.'
artNumber = models.CharField(max_length=100)
name = models.CharField(max_length = 256)
productDownloads = models.ManyToManyField('productModelDownLoad')
productDownloads.help_text = 'Files associated to this product Model.'
def __unicode__(self):
return self.name
class productModelDownload(models.Model):
file = models.FileField(upload_to="products/downloads/")
def __unicode__(self):
return str(self.file)
मैं निम्न त्रुटि:
products.productmodel: 'productDownloads' has an m2m relation with model productModelDownLoad, which has either not been installed or is abstract.
मैं में एक पृष्ठ पाया django दस्तावेज़ जो इसे संबोधित करते हैं, लेकिन मैं इसका अर्थ समझ नहीं पा रहा हूं: http://www.djangoproject.com/documentation/models/invalid_models/
मॉडल मेरे लिए मान्य दिखता है, तो क्या क्या समस्या यहाँ है?
दिलचस्प हिस्सा यह है कि मॉडल के क्रम को बदलकर, वे भी मान्य हो जाते हैं। क्या यह भी वांछित है? –