Simply way to Add IP address

87 views
Skip to first unread message

Alan Viars

unread,
Mar 26, 2014, 3:02:08 PM3/26/14
to django-r...@googlegroups.com
All:

Does anyone one know of a simple way to add the request's IP address to the revisions just like user is added?

Best,

Alan

Dave Hall

unread,
Mar 26, 2014, 5:51:02 PM3/26/14
to django-r...@googlegroups.com
You can attach the request IP address to a revision using custom revision meta:


You'll probably want to create your own middleware that adds the version meta data.


--
You received this message because you are subscribed to the Google Groups "django-reversion discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-reversi...@googlegroups.com.
To post to this group, send email to django-r...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-reversion.
For more options, visit https://groups.google.com/d/optout.

anupa...@gmail.com

unread,
Jul 22, 2017, 5:13:48 AM7/22/17
to django-reversion discussion group
Any idea how to have this custom meta data to show up in the history. It doesnt show up by default and couldnt find much on that on Google search, SO or this forum.

thanks
Anupam

Dave Hall

unread,
Jul 24, 2017, 4:59:44 AM7/24/17
to django-r...@googlegroups.com
To make the custom metadata show up in the admin history view, you will also have to add it to the comment using reversion.set_comment(). This is the easiest approach.

Alternatively, override the reversion/object_history.html template and add code to load and display the metadata from the database.

To unsubscribe from this group and stop receiving emails from it, send an email to django-reversion+unsubscribe@googlegroups.com.
To post to this group, send email to django-reversion@googlegroups.com.
Visit this group at https://groups.google.com/group/django-reversion.

anupa...@gmail.com

unread,
Jul 26, 2017, 6:38:54 AM7/26/17
to django-reversion discussion group
Ah yes, didnt think of that. Putting IP in comments works for me. Putting it in revision meta also, just in case I need to query by IP etc. later.
Reply all
Reply to author
Forward
0 new messages