On Aug 28, 2006, at 8:52 PM, Vizcayno wrote:
> Is there a way to solve my need without using manipulators/validators?

No, actually, because validators are *exactly* what you want to use  
here :)  The right way to do what you want is to add a validator that  
checks that your ``code`` field is uppercase; when that's combined  
with the uniqueness check you'll get the right result.

If you check out http://www.djangoproject.com/documentation/forms/ 
#ready-made-validators, you'll see that Django already includes an  
``isUpperCase`` validator for you, so you should be able to do  
something like::

        from django.db import models
        from django.core.validators import isUpperCase

        class MyModel(models.Model):
                code = models.CharField(maxlength=2, 
validator_list=[isUpperCase])
                description = models.CharField(...)

HTH,

Jacob

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to