I got a way to do these, however a little magic because the logic in
django.db.models.manipulators.ManipulatorDescriptor.__get__ :
...
bases = [self.base]
if hasattr(model, 'Manipulator'): # here we have a
chance to add something to the auto-manipulator.
bases
On Thursday 01 June 2006 08:38, favo wrote:
> > However, you can override the 'validate' method on a model, and you
> > might be able to use that to do what you want (you will probably
> > want a validate method that looks like this:
> >
> > class Category(models.Model):
> > ## fields etc here
Luke Plant wrote:
> On Wednesday 31 May 2006 07:36, favo wrote:
> > somebody know how to use instance method in the validator_list of a
> > field in model? I can't get the "self".
> >
> > class Category(models.Model):
> > ""&qu
Luke Plant wrote:
>However, you can override the 'validate' method on a model, and you
>might be able to use that to do what you want
>
Looks like it doesn't get called from manipulators?
--~--~-~--~~~---~--~~
You received this message because you are subscribed
On Wednesday 31 May 2006 07:36, favo wrote:
> somebody know how to use instance method in the validator_list of a
> field in model? I can't get the "self".
>
> class Category(models.Model):
> """ Inhert Category """
>
> ti
That's what I try to, however, below is what I print the all_data of my
module level validator arguments:
there's no id parameters!! what a bad news.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
favo wrote:
>However, how to replace the default changeManipulator used by
>django-admin?
>
>
Hm... Then my advice won't help...
One thing I can think of is that in your validator you get the object's
id from the all_data and get an object itself with another db request.
Not very good but it
However, how to replace the default changeManipulator used by
django-admin?
--~--~-~--~~~---~--~~
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
favo wrote:
>class Category(models.Model):
>""" Inhert Category """
>
>title_en = models.CharField(maxlength=256, null=True)
>
>parent = models.ForeignKey('self', related_name="direct_children",
>null=True, blank=True, validator_list=[self.isValidParent]) #
>we want the instan
somebody know how to use instance method in the validator_list of a
field in model? I can't get the "self".
class Category(models.Model):
""" Inhert Category """
title_en = models.CharField(maxlength=256, null=True)
parent = models.For
10 matches
Mail list logo