I want a foreign key
relation in my model with the username
field in the User
table(that stores the user
created with django.contrib.auth.forms.UserCreationForm
).
This how my model looks:
class Blog(models.Model):
username = models.CharField(max_length=200) // this should be a foreign key
blog_title = models.CharField(max_length=200)
blog_content = models.TextField()
The username
field should be the foreign key.The Foreign Key should be with this field