STAY INFORMED
following content serves as a personal note and may lack complete accuracy or
certainty.
Minimal-Mistakes instruction
Useful vscode Shortcut Keys
Unix Commands
npm Commands
Vim Commands
Git Note
Useful Figma Shortcut Keys
Share Hub Project_2
Post Model
class Post(models.Model):
title = models.CharField(max_length=30)
content = models.CharField(max_length=20)
author = models.ForeignKey(User, on_delete=models.CASCADE)
def __str__(self):
return self.title
ForeignKey is the field type provided by Django’s ORM, which establishes a one-to-many relationship with other models, where ForeignKey represents a reference to the User model.