Giter Site home page Giter Site logo

Comments (4)

treyhunner avatar treyhunner commented on June 29, 2024

Thanks for submitting this issue @IliynT. This looks like a bug. At first I thought this might be related to #59, but they look like different issues.

We have a test for save_without_historical_record and it seems to work.

A broken test would be ideal for figuring out how to troubleshoot and fix this issue. If you want to try tackling that, see instructions for running the tests here.

Alternatively if you narrow down the issue enough that you're willing to share a whole project that doesn't work someone might be able to devise a test from the broken project and a subsequent fix.

from django-simple-history.

treyhunner avatar treyhunner commented on June 29, 2024

On further inspection it looks like the code example you gave would cause infinite recursion.

save_without_historical_record actually calls save.

The correct way to save without a historical record from the save function is to mimick the save_without_historical_record code and temporarily set skip_history_when_saving to True.

from django-simple-history.

treyhunner avatar treyhunner commented on June 29, 2024

@IliynT did you ever overcome this issue? I'm still not sure whether the problem you were experiencing was due to a bug in django-simple-history.

from django-simple-history.

macro1 avatar macro1 commented on June 29, 2024

Using save_without_historical_record directly in the save method is not currently supported.

If there is call for a feature like this, maybe we should consider save_with_historical_record() as well, and add a flag such as 'auto_track_saves' to the HistoricalRecords class __init__ method?

from django-simple-history.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.