Re: how to use instance method in the validator_list of a field in model?

2006-06-02 Thread favo
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

Re: how to use instance method in the validator_list of a field in model?

2006-06-01 Thread Luke Plant
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

Re: how to use instance method in the validator_list of a field in model?

2006-06-01 Thread favo
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

Re: how to use instance method in the validator_list of a field in model?

2006-05-31 Thread Ivan Sagalaev
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

Re: how to use instance method in the validator_list of a field in model?

2006-05-31 Thread Luke Plant
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

Re: how to use instance method in the validator_list of a field in model?

2006-05-31 Thread favo
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"

Re: how to use instance method in the validator_list of a field in model?

2006-05-31 Thread Ivan Sagalaev
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

Re: how to use instance method in the validator_list of a field in model?

2006-05-31 Thread favo
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

Re: how to use instance method in the validator_list of a field in model?

2006-05-31 Thread Ivan Sagalaev
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

how to use instance method in the validator_list of a field in model?

2006-05-30 Thread favo
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