Hi. This is something that only occurs in the shell environment, not in the 
web. If I have this model:

class Phone_App(models.Model):
    phone= models.ForeignKey(Phone, on_delete=models.CASCADE)
    app_name = models.ForeignKey(App, on_delete=models.CASCADE)
    downloads = models.IntegerField(default=0, editable=False)
    apk_file = ContentTypeRestrictedFileField(upload_to=get_upload_path,
                                
content_types=['application/vnd.android.package-archive', ],
                                max_upload_size=214958080,
                                max_length=500)

I can create apps with None fields:
Phone_App.objects.create(phone=self.r1_v1, app_name=self.app1)

Also, with:
class Phone(models.Model):
    phone_name = models.CharField(max_length=200, null=False, blank=False)
    version = models.CharField(max_length=20, blank=True, null=True)

    class Meta:
            unique_together = ('phone_name', 'version',)

I can create objects using:

Robot.objects.create(version="Version test")

What's wrong? Thx!

-- 
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/4aba95b6-ce53-4462-b3f5-1f652930b4c6n%40googlegroups.com.

Reply via email to