[Django]-Django m2m model not syncing

4👍

You missed to define your intermediate model correctly

class Service_Category(models.Model):

    category = models.ForeignKey(Category)
    service = models.ForeignKey(Service)
    micro_current = models.BooleanField(default = False)


    class Meta:
        #app_label = ''
        db_table = 'service_categories'

We have to inherit each of our model which we define from models.Model class.
Rest everything seems to be fine.

0👍

Service_Category needs to inherit from models.Model

i.e, class Service_Category(models.Model):

Leave a comment