Hello,
I have an application it was working pretty good till this happen.
1st- I use sqlite DB it have 46 tabels.
2nd- I am trying to creat a new table (botomeqpts) as:
1- in models.py created this:
class Botomeqpts(models.Model):
code_BtE = models.CharField(max_length=16,unique=True)
designation = models.CharField(max_length=150)
fournisseu = models.CharField(max_length=80)
Emplacement = models.CharField(max_length=20)
Qte_stock = models.IntegerField(blank=True, null=True)
Nbr_comnd = models.CharField(max_length=10,blank=True ,null=True)
Nbr_comndQ = models.IntegerField(blank=True ,null=True)
Observation = models.TextField(blank=True ,null=True)
mvmnt_date = models.DateField(blank=True ,null=True)
author_Up = models.CharField(max_length=16,blank=True ,null=True) #CASCADE()
date_Up = models.DateField(blank=True ,null=True)
post_date = models.DateTimeField(default=timezone.now)
author = models.ForeignKey(User,on_delete=models.CASCADE) #CASCADE()
def __str__(self):
return self.code_BtE
class Meta:
ordering = ('-post_date',)
2- I registered the model name in admin.py as:
admin.site.register(Botomeqpts)
3- I run the following code of migration:
makemigrations
migrate --fake
And after from the admin panel I checked the table (Botomeqpts)
and It appear in the list but when I try to add the data it give me this error (image1)?
and when I explore the database from Sqlite browser I don’t found the table (image3) ???
But from the admin I found the Table name as (image2)
and trying to add some data it gives me the page (image4), but when register it give me tha error as presented in the first picture (image1)!??
So please do I forget and step or I made an error (I’d 7 months didn’t used Django )
All My Best