regression tests for django builtin views an abstract article model so that we can create article models with and without a getabsoluteurl method for createupdate generic views tests an article class with a getabsoluteurl defined an article model with a datefield instead of datetimefield for testing 7602 an abstract article model so that we can create article models with and without a get_absolute_url method for create_update generic views tests an article class with a get_absolute_url defined an article model with a datefield instead of datetimefield for testing 7602
from django.db import models


class Author(models.Model):
    name = models.CharField(max_length=100)

    def get_absolute_url(self):
        return "/authors/%s/" % self.id


class BaseArticle(models.Model):
    

    title = models.CharField(max_length=100)
    slug = models.SlugField()
    author = models.ForeignKey(Author, models.CASCADE)

    class Meta:
        abstract = True


class Article(BaseArticle):
    date_created = models.DateTimeField()


class UrlArticle(BaseArticle):
    

    date_created = models.DateTimeField()

    def get_absolute_url(self):
        return "/urlarticles/%s/" % self.slug

    get_absolute_url.purge = True


class DateArticle(BaseArticle):
    

    date_created = models.DateField()