mamweb/seminar/models/base.py

24 lines
496 B
Python
Raw Normal View History

2021-10-08 18:06:02 +02:00
from django.urls import reverse
from django.db import models
class SeminarModelBase(models.Model):
class Meta:
abstract = True
2021-10-08 18:06:02 +02:00
def verejne(self):
return False
2021-10-08 18:06:02 +02:00
# def get_absolute_url(self):
# return "https://" + str(get_current_site(None)) + self.verejne_url()
2021-10-08 18:06:02 +02:00
def admin_url(self):
app_name = self._meta.app_label
model_name = self._meta.model_name
return reverse('admin:{}_{}_change'.format(app_name, model_name), args=(self.id, ))
2021-10-08 18:06:02 +02:00
# def verejne_url(self):
# return None