Giter Site home page Giter Site logo

Comments (3)

treyhunner avatar treyhunner commented on June 29, 2024

Thanks for reporting this @BeccaMG!

I'm aware of this issue but it looks like it never made it into the issue tracker. Let's use this ticket to start the discussion about history on fixture-loaded data.

The test_raw_save test demonstrates this bug. Fixtures send a raw=True and django-simple-history does not save historical data for raw saves. It looks like this was disabled in 0fd9b8e.

I'm not sure what the downsides might be to forcing historical model creation on raw saves. Maybe we should look into this (try it out and see what tests fail, research raw and possible downsides to recording history when raw=True, etc.).

A process for manually creating historical records for existing data (like #60) may provide a workaround for this problem (since historical records could be created after fixtures are loaded).

from django-simple-history.

macro1 avatar macro1 commented on June 29, 2024

First: Fixtures are pretty useful, but a solution like Factory Boy or Model Mommy may be more useful, especially in the long run.

As @treyhunner mentioned, there is now a populate_history command that will allow you to create historical versions of existing model instances. It appears to be undocumented though.

Personally, I'm against populating when raw=True. It looks like the idea behind that flag is to have the fixture data load directly into the database without side effects. If you wish the historical data to load as well, you could add fixtures for the historical models, correct? I could be speaking out of ignorance though, because I have not used the fixture features in Django.

from django-simple-history.

macro1 avatar macro1 commented on June 29, 2024

Closing... I believe #153 is a related issue. We should probably add some documentation about migration and fixture cases.

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.