I've recently read about `clean_fields()` and decided to move some
stuff to I that I was doing in my `pre_save` handler previously. My
tests failed and then I noticed that neither `clean_fields()` nor
`full_clean()` was ever called before saving the model.
The documentation says that only
> So If I create a newforms field then how do I tell the admin to use
> that when building the form in the admin?
You will need to use the newforms-admin branch to get the admin to use
a newforms field ;)
Btw: If you just want the regex functionality you can use the
RegexField of newforms like
> So If I create a newforms field then how do I tell the admin to use
> that when building the form in the admin?
If you need this in admin then possibly you have to define your own
newforms field
with validation. It may be called: myfields.MyField
Then you define descednant of CharField from
On Feb 7, 2:53 am, Pigletto <[EMAIL PROTECTED]> wrote:
> On 7 Lut, 09:58, Mackenzie Kearl <[EMAIL PROTECTED]>
> wrote:> I am having trouble finding documentation on how to add custom
> > validation to a custom model field.
>
> > example:
>
> > class PostalField(models.CharField):
> > def
On 7 Lut, 09:58, Mackenzie Kearl <[EMAIL PROTECTED]>
wrote:
> I am having trouble finding documentation on how to add custom
> validation to a custom model field.
>
> example:
>
> class PostalField(models.CharField):
> def __init__(self,*args,**kwargs):
>
I am having trouble finding documentation on how to add custom
validation to a custom model field.
example:
class PostalField(models.CharField):
def __init__(self,*args,**kwargs):
kwargs['max_length']= 6
super(PostalField, self).__init__(*args, **kwargs)
6 matches
Mail list logo