Temporal table in Django 1.6

243 views
Skip to first unread message

Nirali Supe

unread,
May 21, 2018, 3:18:50 PM5/21/18
to Django users
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

Daniel Germano Travieso

unread,
May 21, 2018, 5:48:00 PM5/21/18
to django...@googlegroups.com
Hello!

First of all, I highly recommend you to use django 1.8 or upper, as de 1.6 version is no longer supported by the official django development.
After that note, as you can see, the database engine backends that come bundled with Django are as follows ( https://docs.djangoproject.com/en/2.0/ref/settings/#engine )

  • 'django.db.backends.postgresql'
  • 'django.db.backends.mysql'
  • 'django.db.backends.sqlite3'
  • 'django.db.backends.oracle'

But as stated on the same page, you can create your own backend (one that supports Temporal Tables on another DBMS - suche as MS SQL Server 2016) and bundle it with your app. To see the appropriate documentation for the databases api for you to create the backend, just go to the appropriate section ( https://docs.djangoproject.com/en/2.0/ref/databases/ ).

Another option is for you to find an app available somewhere out there on the internet that provides a backend with Temporal Tables.

Hope it helps!

[]'s
Daniel Germano Travieso
Engenharia da Computação Turma: 013
Unicamp

--
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...@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.
For more options, visit https://groups.google.com/d/optout.

Anthony Flury

unread,
May 24, 2018, 7:54:10 PM5/24/18
to django...@googlegroups.com, Nirali Supe
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 : *Anthon...@btinternet.com*
Twitter : *@TonyFlury <https://twitter.com/TonyFlury/>
> --
> 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...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> <https://groups.google.com/d/msgid/django-users/918a65bb-e9c3-42fb-9170-6e5092b62bc5%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages