Skip to content

Instantly share code, notes, and snippets.

@markng
Created March 28, 2022 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markng/4f84565329e3e60a843395da5c373cca to your computer and use it in GitHub Desktop.
Save markng/4f84565329e3e60a843395da5c373cca to your computer and use it in GitHub Desktop.
from django.contrib.auth.models import User
from django.db import models
class Topic(models.Model):
title = models.CharField(max_length=30)
created_by = models.ForeignKey(User, on_delete=models.CASCADE)
created_at = models.DateTimeField(auto_now_add=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment