Re: validate fields in the admin as some local flavor form fields

2008-11-24 Thread TeenSpirit83

Yes, I think we should isolate the condition to he interested field
without touching every other.
So could it be
if db_field == cuit
??

thanks ramiro ;)


On 20 Nov, 00:01, "Ramiro Morales" <[EMAIL PROTECTED]> wrote:

> The condition in line 16 can (and in fact should) be made more
> specific to include the name
> of the field.
>

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: validate fields in the admin as some local flavor form fields

2008-11-19 Thread Ramiro Morales

On Mon, Nov 17, 2008 at 10:00 PM, TeenSpirit83
<[EMAIL PROTECTED]> wrote:
>
> I'm writing an app with some italian zip and vat number fields and
> also a province select field
> can i force the admin class to validate the fields like
> class it.forms.ITVatNumberField
> class it.forms.ITZipCodeField
> class it.forms.ITProvinceSelect
> ??

There was a thread in the django-es mailing list a while ago about a
similar requirement, the OP needed being able to replace a generic
model-derived field in the admin app forms with a localflavor form field
that uses the same database column type, this would have the same effect
you are looking for: having the specific validation being aplied to it:

http://groups.google.com/group/django-es/browse_thread/thread/ead0c017040a8cd4/56dc130cbe269b9d?hl=en&lnk=gst

What we came up with was:

http://dpaste.com/hold/73468/

that uses the formfield_for_dbfield() ModelAdmin method.

The condition in line 16 can (and in fact should) be made more
specific to include the name
of the field.

There could be another way though, take a look at this documentation section:

http://docs.djangoproject.com/en/dev/ref/contrib/admin/#adding-custom-validation-to-the-admin

Regards,

--
 Ramiro Morales

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: validate fields in the admin as some local flavor form fields

2008-11-19 Thread TeenSpirit83

no answers!
i think there's no solution :(
how can i create my validation rules for those fields?

On 18 Nov, 01:00, TeenSpirit83 <[EMAIL PROTECTED]> wrote:
> I'm writing an app with some italian zip and vat number fields and
> also a province select field
> can i force the admin class to validate the fields like
> class it.forms.ITVatNumberField
> class it.forms.ITZipCodeField
> class it.forms.ITProvinceSelect
> ??
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



validate fields in the admin as some local flavor form fields

2008-11-17 Thread TeenSpirit83

I'm writing an app with some italian zip and vat number fields and
also a province select field
can i force the admin class to validate the fields like
class it.forms.ITVatNumberField
class it.forms.ITZipCodeField
class it.forms.ITProvinceSelect
??
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---