Unknown column 'boericke_joints.id' in 'field list

2019-06-11 Thread James Farris
If the database was originally created by Django, it would have been built with 
an ID field. Django is confused because it can’t find that field in the 
database. If you added ID to the model, did you run python manage.py 
makemigrations and then python manage.py migrate

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cf82c1b4-3b7a-4d7c-87a3-9b182c92b59a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Unknown column 'boericke_joints.id' in field list

2019-06-10 Thread Rishi Raj Jain
I'm using an already existing database and I followed steps in the 
documentation.
It connects fine, but when I try to view data already in the database I get 
the error:

(1054, "Unknown column 'boericke_joints.id' in 'field list'")

I added a primary Id key that's required by django but I keep getting the same 
error. I also did migrate command. Kindly help solve this issue. Thanks in 
advance.




models.py is as follows:


class BoerickeJoints(models.Model):
id = models.IntegerField(primary_key=True)
medicine = models.CharField(max_length=75, blank=True, null=True)
section = models.CharField(max_length=100, blank=True, null=True)
details = models.TextField(blank=True, null=True)

class Meta:
db_table = 'boericke_joints'

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6c83df72-b170-422c-8b47-be9a34d05b83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Unknown column 'boericke_joints.id' in 'field list

2019-06-10 Thread Rishi Raj Jain
I'm using an already existing database in mysql. 
When I try to list the contents of the database it gives the following 
error:
(1054, "Unknown column 'boericke_joints.id' in 'field list'")
 The table doesn't contain an ID field. 

models.py looks like this ;

class BoerickeJoints(models.Model):
id = models.IntegerField(primary_key=True)
medicine = models.CharField(max_length=75, blank=True, null=True)
section = models.CharField(max_length=100, blank=True, null=True)
details = models.TextField(blank=True, null=True)

class Meta:
db_table = 'boericke_joints'


I added the id section and set it as the primary key, this is required by 
django apparently. but it still doesn't solve my issue.

Kindly help me in resolving this, thanks in advance.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8cd0d19c-5aa1-4d3b-9b7a-8a97bb2854ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.