Skip to content
Snippets Groups Projects
Verified Commit d819bf4b authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Make all models site-aware

parent 4df56a35
No related branches found
No related tags found
1 merge request!235Resolve "Switch to sites framework"
......@@ -2,6 +2,8 @@ from datetime import datetime
from typing import Any, Callable, Optional, Union
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.managers import CurrentSiteManager
from django.contrib.sites.models import Site
from django.db import models
from django.db.models import QuerySet
from django.forms.models import ModelFormMetaclass, ModelForm
......@@ -78,6 +80,10 @@ class ExtensibleModel(CRUDMixin):
# Defines a material design icon associated with this type of model
icon_ = "radio_button_unchecked"
site = models.ForeignKey(Site, on_delete=models.CASCADE)
objects = CurrentSiteManager()
objects_all_sites = models.Manager()
def get_absolute_url(self) -> str:
""" Get the URL o a view representing this model instance """
pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment