Saturday, April 28, 2012

Re: Edit-once object in admin?

I think you have to change your model.

Override the save() method to raise an exception if "self.id is not None."

This won't prevent developers from using the 'update()' or 'delete()'
methods of a queryset, but for a single instance it shouldn't be
editable. It will still be able to be deleted, unless you override
delete() as well.

--
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.

No comments:

Post a Comment