Initial commit of the generic history app

This commit is contained in:
Roberto Rosario
2011-05-26 05:07:26 -04:00
parent ecdc72f16c
commit 6c3aa1f37b
15 changed files with 369 additions and 5 deletions
+10
View File
@@ -0,0 +1,10 @@
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
#from django.shortcuts import get_object_or_404
class ObjectHistoryManager(models.Manager):
def get_url_for_object(self):
ct = ContentType.objects.get_for_model(self.instance)
return reverse('history_for_object', args=[ct, self.instance.pk])