class Product(models.Model):
...
image = models.ImageField(upload_to = generate_filename, blank = True)
जब मैं ImageField (blank = True) का उपयोग करता हूं और व्यवस्थापक रूप में छवि का चयन नहीं करता, अपवाद अवसर।Django - ImageField/FileField वैकल्पिक कैसे बनाएं?
Django कोड में आप यह देख सकते हैं:
class FieldFile(File):
....
def _require_file(self):
if not self:
raise ValueError("The '%s' attribute has no file associated with it." % self.field.name)
def _get_file(self):
self._require_file()
...
Django Trac इस समस्या के बारे टिकट # 13,327 है, लेकिन यह जल्द ही तय नहीं किया जा सकता है लगता है। इन फ़ील्ड को वैकल्पिक कैसे बनाएं?
क्या आपको कोई समाधान मिला, ऐसा लगता है कि मेरे पास अब एक ही समस्या है – niklas