Simple django app to display links
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
488 B

  1. from django.db import models
  2. # Create your models here.
  3. class Category(models.Model):
  4. class Meta(object):
  5. verbose_name_plural = "categories"
  6. name = models.CharField(max_length=40)
  7. def __str__(self):
  8. return self.name
  9. class Link(models.Model):
  10. friendly_name = models.CharField(max_length=40)
  11. url = models.URLField(max_length=255)
  12. category = models.ForeignKey(Category, on_delete=models.CASCADE)
  13. def __str__(self):
  14. return self.url