Although Django doesn't support the Temporal tables directly - it gives
you all the tools you need to create one.
And there are some installable extensions :
django-temporal-models :
https://github.com/TyumenGortrans/django-temporal-models
You should be able to install it by
pip install django-temporal-models
The documentation is in Russian, and it does only seem to support
Python 2 - but it might give you some ideas of how to implement it.
If I was implementing this on my own, I would have two models for the
data and the history. I would use triggers to track updates, deletions
on the data etc (all of which would write to the history), and then have
a OneToMany relationship from your data table to the history table.
Writing the signals wouldn't be that difficult; every change creates a
new row in the history with the current data time.
To create a well rounded extension (like the one above) is more work -
but for a specific solution for your project, implementing your own
shouldn't be that difficult
--
--
Anthony Flury
email : *Anthony.flury@btinternet.com*
Twitter : *@TonyFlury <https://twitter.com/TonyFlury/>
*On 21/05/18 20:13, Nirali Supe wrote:
> Hello,
>
> I need to create Temporal table in Django 1.6
> Does Django support Temporal table model? I unable to find the Django
> documentation on it.
> Can someone please point me to the documentation?
>
> Thank you,
> Nirali Supe
> --
> 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+unsubscribe@googlegroups.com
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/918a65bb-e9c3-42fb-9170-6e5092b62bc5%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/918a65bb-e9c3-42fb-9170-6e5092b62bc5%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/14e753f9-4370-75cf-5767-3c7815bae16b%40btinternet.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment