Reputation: 343
Hi i am trying to generate migration but all fields are not getting created into the db. Below is my code.
from django.db import models
class News(models.Model):
author = models.CharField(max_length = 100),
content = models.CharField(max_length= 100),
description = models.TextField(default= "")
def __str__(self):
return self.author
class Meta:
db_table = "news"
class SportNews(models.Model):
author = models.CharField(max_length = 100),
content = models.CharField(max_length = 100),
description = models.TextField(default = "")
def __str__(self):
return self.author
class Meta:
db_table = "sports_news"
Upvotes: 1
Views: 1508
Reputation: 3920
You are putting comma after defining each field. Remove them and you are good to go!
Upvotes: 14