Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 465661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:24:00+00:00 2026-05-12T23:24:00+00:00

I’d like to create a feature for my Django app similar to Django admin’s

  • 0

I’d like to create a feature for my Django app similar to Django admin’s ‘Recent Actions’, in order to store history information on my other models.

For example say I have two models called Book and Author. I want to have a third model that stores information such as what action was performed on a given object in a model (add, modify, delete, etc.) by who and when.

Who, when and the action are easy, I’m just unsure about how to store information regarding what object the action was performed on.

My initial idea was to have a ‘Transactions’ model that would store this information, and both my Book and Author models could have a ForeignKey relation to it. However, if I delete the given book or author, then its transaction history is also deleted and I have no record that this object was indeed deleted.

I’ve been thinking of other possible solutions, but I thought I’d ask for more experienced opinions here first. How should I approach this problem and what are some reasonable solutions to it?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T23:24:01+00:00Added an answer on May 12, 2026 at 11:24 pm

    You might want to check out django-reversion — Either to implement or to learn from it for your own implementation. Django reversion works by saving information about the change, along with a serialized copy of the item as it existed at that one moment. This means that you can later recall that one specific item and do a comparison or restoration or whatever.

    If you decide to implement your own custom solution, I’d recommend making use of Django’s built in signal sub-system. Django out-of-the-box provides the common signals for things you mentioned like model creation, saving, and deleting. You could add in custom signals as well if you found the need for them.

    Using signals would allow you to develop the ‘history’ code separate from the Book/Author implementation code which in the long run will be an asset (as opposed to stringing history code throughout the Book/Author code). Again django-reversion serves as a good reference here by doing its work almost entirely with signals.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I would like to run a str_replace or preg_replace which looks for certain words
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.