2015-02-10 21:11:25 +08:00
|
|
|
from django.db import models
|
2015-12-30 23:51:16 +08:00
|
|
|
from django.urls import reverse
|
2015-02-10 21:11:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
class TestModel(models.Model):
|
|
|
|
name = models.CharField(max_length=100)
|
2017-03-18 03:25:50 +08:00
|
|
|
lastmod = models.DateTimeField(null=True)
|
2015-02-10 21:11:25 +08:00
|
|
|
|
|
|
|
def get_absolute_url(self):
|
|
|
|
return '/testmodel/%s/' % self.id
|
|
|
|
|
|
|
|
|
|
|
|
class I18nTestModel(models.Model):
|
|
|
|
name = models.CharField(max_length=100)
|
|
|
|
|
|
|
|
def get_absolute_url(self):
|
|
|
|
return reverse('i18n_testmodel', args=[self.id])
|