The admin interface contains a history feature, you might want to look
at how that works. Apart from a table to record the actual changes,
there is a "relationship" table that links the model that is changed
with the log record (i.e. the log isn't tied to a particular table
because of this).
Table names are "django_admin_log" and "django_content_type"

 -rob

On Jul 29, 11:01 pm, Mir Nazim <[EMAIL PROTECTED]> wrote:
> Hello
>
> I was wondering what is the best possible way of maintaning history of
> changes to the fields of models.
>
> Like we do in Bug trackers, where we maintain a complete log of
> changes to the fields.
>
> One simple solution that came to my mind is creating a model History.
> as
>
> class History(models.Model):
>     model_changed = models.CharField(maxlength=255, blank=False)
>     old_data = models.TextField(blank=False)
>     created = models.DateTimeField(auto_now = True)
>
> Then before saving the model objects its old value get pushed in the
> History.old_data in json, pickle or some other format. But this is
> very bad way to do it. Because generating reports is not a simple task
> when using pickled data.
>
> You guys might have faced similar problems, can any one suggest a
> better way of maintaining history.
>
> One thing to consider here however is that models  are deeply
> connected with lot of relationships between them.
>
> Thanks


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to