Thanks for the quick reply, Arthur.
I've gone over the MR version of doing this, by overwriting delete(),
which seems to be like a good approach. I have not tried to add it to
my code, because due to some bad management, I'm currently not
working on that particular code. In a way, the problem
I totally agree with Glenn.
Every day I suffer of the lack of example in the Python doc.
It would be great that Django does it better.
Olivier.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group
On Tue, Apr 11, 2006 at 04:16:09PM -0400, Max Battcher wrote:
> "pass" is the Python "do nothing" command, which is often used as an
> indicator to "fill in the blanks" with your own specific code (because
> Python doesn't allow empty functions it is often seen in psuedo-code).
yes... yes... I kn
On 4/11/06, Glenn Tenney <[EMAIL PROTECTED]> wrote:
>
> On Tue, Apr 11, 2006 at 02:24:04PM -0400, Max Battcher wrote:
> > You are free to raise your own exception in the path that fails to
> > call super().delete() in M-R.
>
> Then perhaps the docs etc. should instead show "raise "
> instead of "p
On Tue, Apr 11, 2006 at 06:19:49PM -, arthur debert wrote:
> the thing is, if there's anything in django's knowledge to avoid the
> save / delete it DOES raise an error. (such as trying to delete an non
> existant object or trying to save a model that does not pass
> validation). my guess here
On Tue, Apr 11, 2006 at 02:24:04PM -0400, Max Battcher wrote:
> You are free to raise your own exception in the path that fails to
> call super().delete() in M-R.
Then perhaps the docs etc. should instead show "raise "
instead of "pass"... When one shows as an example to use "pass",
it misleads
On 4/11/06, Glenn Tenney <[EMAIL PROTECTED]> wrote:
>
> On Tue, Apr 11, 2006 at 05:01:39PM -, arthur debert wrote:
> > more on this here:
> > http://code.djangoproject.com/wiki/RemovingTheMagic#Addedamorepowerfulwayofoverridingmodelmethodsremovedhardcoded_pre_save_post_saveetc.
>
>
> Everythin
Hi Glenn.
the thing is, if there's anything in django's knowledge to avoid the
save / delete it DOES raise an error. (such as trying to delete an non
existant object or trying to save a model that does not pass
validation). my guess here is if you need anything else in you logic
that django does
On Tue, Apr 11, 2006 at 05:01:39PM -, arthur debert wrote:
> more on this here:
> http://code.djangoproject.com/wiki/RemovingTheMagic#Addedamorepowerfulwayofoverridingmodelmethodsremovedhardcoded_pre_save_post_saveetc.
Everything that I read there shows that you can choose to save or
not-sav
Hi Norbert,
this is not possible on trunk , if you are using magic-removal, you can
do it like this:
def delete(self):
if conditionIsMet == True:
super(ModelName, self).delete() # Call the "real" delete()
method.
else:
# Don't delete.
pass
more
10 matches
Mail list logo