Source code for django_core.db.models.mixins.urls

from __future__ import unicode_literals

from django.db import models
from django_core.html.builders import build_link


[docs]class AbstractUrlLinkModelMixin(models.Model): """Mixin for accessing the links for the models. This requires the object to have already implemented the following methods: To override the model field used for the absolute url, override the following method: * get_link_text_field() to the model and that field will be used for the text. * get_absolute_url - returns the absolute link to the object. * get_edit_url - returns the link to edit the object * get_delete_url - return the link to delete the object. """ class Meta: abstract = True