First I should thank Ivan for your help. But I think Malcolm figured
out what I really want.
Maybe django should catch Exception when calling a model's save /
delete method.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
On Sat, 2006-08-12 at 21:56 +0400, Ivan Sagalaev wrote:
> 一首诗 wrote:
> > But how can I give some information to user that the delete is not
> > allowed?
> > By the codes above, the user just see that the delete was done!
>
> This is exactly the case for using exceptions. Define your own
一首诗 wrote:
> But how can I give some information to user that the delete is not
> allowed?
> By the codes above, the user just see that the delete was done!
This is exactly the case for using exceptions. Define your own exception
and raise it where user shouldn't delete an object. Then define a
I want to override delete()
===
from django.db import models
class Person(models.Model):
first_name = models.CharField(maxlength=20)
last_name = models.CharField(maxlength=20)
def delete(self):
if ( A ):
super(Person,
4 matches
Mail list logo