Re: Append only tables/models
On Oct 25, 2012, at 8:26 AM, Mike Burr wrote:
> I know there are DBMS-specific ways of doing this. I know that there
> are Django ways of making fields read-only. What I cannot find is a
> way to make a table/model append-only.
You can always override the .save() method to check to see if the pk field is None, and refuse to save if it is not:
https://docs.djangoproject.com/en/1.4/topics/db/models/#overriding-predefined-model-methods
That being said, this kind of thing is *much* better done at the DB level, so that you can be certain that there are no other paths that allow data to be updated.
--
-- Christophe Pettus
xof@thebuild.com
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home