Hello all, My problem is as follows: I have content (for simplicity, lets say articles), and some content related to that (authors for the example). I would like to add the ability for users to create versions of the content. The procedure from user perspective is as follows: they click a button ("create new version") and supply some details about the update.
Now, I would like to automatically generate dual tables for articles and content which would be versioned. That is, when users click "create new version" my software should insert the current data into the dual tables so that it is possible to go back to each published version. The problem I am facing is this: I would like to create automatically the dual tables. I haven't thought about the schema much, but I probably don't need anything more than the base tables + an integer column version. Is there any relatively easy way to create the dual tables automatically? That is, is it possible to read the models I have currently and create the dual table without me having to copy all the definitions. For example, given the article model: class Author(models.Model): name = models.TextField() class Article(models.Model): id = models.AutoField() text = models.TextField() authors = models.ManyToManyField(Author) I would like to create automatically (in runtime or just create the models.py file automatically running a script) the dual models: class AuthorDual(models.Model): name = models.TextField() version = models.PositiveIntegerField() class ArticleDual(models.Model): id = models.AutoField() text = models.TextField() authors = models.ManyToManyField(AuthorDual) version = models.PositiveIntegerField() Has anybody done anything similar? Any pointers where to look for similar code? And is this doable in sane amount of time? Thanks in advance, - Anssi -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.