Monday, November 11, 2019

Re: Error while uplaoding the models data from excel through admin page

Error seems to be in allotment_exam.Examname model. 

The model code which you have pastes is of "Exam"


Regards, 

Parth Joshi



On 10-Nov-2019, at 11:34 AM, Mohan Goud <kathi.mohangoud@gmail.com> wrote:



I have to import the data into models from excel sheet from admin site and the code is

models.py

class Exam(models.Model): Examname = models.CharField(null=False, blank=False, max_length=255)
class Meta: unique_together = ["Examname"]
def str(self): return self.Examname

admin.py

@admin.register(Exam) class ViewAdmin(ImportExportModelAdmin): exclude = ('id', )

While importing the data the errors are Line number: 2 - NOT NULL constraint failed: allotment_exam.Examname and Line number: 3 - NOT NULL constraint failed: allotment_exam.Examname


--
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/CAB29Dkm6toxTQiYy2-8BREdv0z%2B2go87eO4o-%2BeUAys6yfN44g%40mail.gmail.com.

No comments:

Post a Comment