Skip to content

Instantly share code, notes, and snippets.

@tamert
Last active September 15, 2020 18:47
Show Gist options
  • Save tamert/13c07d804661f03f0c6a95512e516f6d to your computer and use it in GitHub Desktop.
Save tamert/13c07d804661f03f0c6a95512e516f6d to your computer and use it in GitHub Desktop.
model.py
from django.db import models
class Company(models.Model):
name = models.CharField(max_length=200, unique=True)
email = models.EmailField(unique=True)
www = models.URLField()
linkedin = models.URLField(null=True,)
pub_date = models.DateTimeField(null=True)
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment