Hey, no problem! My apologies for missing out on this thread for a while. I hope you got it figured out!
Anyways, I'm thinking that if you're actually basing this validation (done in your clean method), you may want to use a ForeignKey Field. You can define a custom queryset to filter through the results if you only want certain teachers to be available. Otherwise, you could put a method along these lines in your current Form class. import Teacher from (some django forms module) import ValidationError class MyForm(Form): ... def clean__teacher(self): teacher = self.cleaned_data['teacher'] # Value of the chosen teacher if Teacher.objects.filter(name=teacher).exists(): return True else raise ValidationError("You have chosen an invalid teacher") Hopefully that helps a bit. If not, let me know and I'll try to help some more :) On Fri, May 18, 2012 at 2:57 AM, HDayi <hacid...@gmail.com> wrote: > hi curtis, > sorry for being so late. > > on the page i have given the url, it's told exactly how you said. I have > subclassed djangos choicefield and just changed validation method that > always return true. so my own clean_fieldname method started to work fine. I > am checking the returned valu if exist in my database table. > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/Y_isSMVE4lcJ. > > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.