hi all something like this had already been reported: http://code.djangoproject.com/ticket/6138
i tried sean's solutions but nothing happens... stand by... ;) On May 8, 7:25 pm, Julián C. Pérez <[email protected]> wrote: > thank you,s ean > i will try > ahh one thing i'd like to comment... > when creating an ProfileForm object I even give it the class as an > argument like this: > ... > profile, created = Profile.objects.get_or_create(user=request.user) > myProfileForm = ProfileForm(request.POST, instance=profile, > error_class=DivErrorList) > ... > but nothing happens... that object still uses the default error class > > another question on my mind... > how can i assing to that form a custom class?? > i mean, to create something like: > ... > <input id="id_username" class="myCustomClass" type="text" value="type > here your username"/> > ... > i'd like to achieve that in order to control those fields using jquery > -for validation reasons > > thank you all! > > On May 8, 12:13 pm, Sean Brant <[email protected]> wrote: > > > Try this, not tested but it might work. > > > class ProfileForm(forms.ModelForm): > > def __init__(self, *args, **kwargs): > > self.error_class = DivErrorList > > super(ProfileForm, self).__init__(*args, **kwargs) > > > class Meta: > > model = P > > exclude = ('date', 'user', 'public') > > > When you override a class method you need to make sure to call super > > inside it. This calls the classes parent method. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---

