using historic changes from django-admin to templates?

28 views
Skip to first unread message

somen...@gmail.com

unread,
Aug 17, 2014, 3:47:12 PM8/17/14
to django...@googlegroups.com
Hi,

I just ask if it's possible (and how) to use the "historic changes" of django-admin interface to templates for showing what changes I've made in my models in my site.

Can anyone follow the Poll examples of the tutorial.

Thanks in advance,
Xan

Cal Leeming [iops.io]

unread,
Aug 17, 2014, 6:39:46 PM8/17/14
to django...@googlegroups.com
Several projects have attempted this, though personally I don't feel any of them are the right solution;

Django reversion is probably your best bet, and although I don't agree with the approach, it gets the job done;

Cal


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4fa8cf97-bd5e-4029-9fc6-ea2ec833acec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Collin Anderson

unread,
Aug 18, 2014, 12:30:28 AM8/18/14
to django...@googlegroups.com
Or, is the data on the admin "history" page good enough? You could just import LogEntry and start querying it. The model is undocumented and not guaranteed to be a stable API, but you can see the model here:

somen...@gmail.com

unread,
Aug 18, 2014, 11:11:46 AM8/18/14
to django...@googlegroups.com
Thanks, Collin. This is what I want.
How can I import LogEntry and use it? I'm yet a newbee ;-)

El dilluns 18 d’agost de 2014 2:30:28 UTC+2, Collin Anderson va escriure:

Collin Anderson

unread,
Aug 18, 2014, 11:35:43 AM8/18/14
to django...@googlegroups.com
from django.contrib.contenttypes.models import ContentType
from django.contrib.admin.models import LogEntry

for log in LogEntry.objects.filter(content_type=ContentType.objects.get_for_model(YourModel)):
print log
Reply all
Reply to author
Forward
0 new messages