You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
489 B
22 lines
489 B
from django.db import models
|
|
|
|
# Create your models here.
|
|
|
|
|
|
class Category(models.Model):
|
|
class Meta(object):
|
|
verbose_name_plural = "categories"
|
|
|
|
name = models.CharField(max_length=40)
|
|
|
|
def __str__(self):
|
|
return self.name
|
|
|
|
|
|
class Link(models.Model):
|
|
friendly_name = models.CharField(max_length=40)
|
|
url = models.CharField(max_length=255)
|
|
category = models.ForeignKey(Category, on_delete=models.CASCADE)
|
|
|
|
def __str__(self):
|
|
return self.url
|