Re: Need help with a modelChoiceField
> label_from_instance was added after that version. For now the only > thing you can do is to define __unicode__ on the Upload model, and > that will provide the value that is displayed. > -- > DR. worked like a charm Daniel... thanks again! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Need help with a modelChoiceField
On Fri, Aug 7, 2009 at 2:57 PM, Daniel Roseman wrote: > > On Aug 7, 7:33 pm, Bobby Roberts wrote: > > hi. does anyone have any ideas why this is not working... we are > > using django 0.96 on this particular server. > > label_from_instance was added after that version. For now the only > thing you can do is to define __unicode__ on the Upload model, and > that will provide the value that is displayed. > No __unicode__ in 0.96. Probably __str__. Karen --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Need help with a modelChoiceField
On Aug 7, 7:33 pm, Bobby Roberts wrote: > hi. does anyone have any ideas why this is not working... we are > using django 0.96 on this particular server. label_from_instance was added after that version. For now the only thing you can do is to define __unicode__ on the Upload model, and that will provide the value that is displayed. -- DR. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Need help with a modelChoiceField
hi. does anyone have any ideas why this is not working... we are using django 0.96 on this particular server. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Need help with a modelChoiceField
ok here's my form: class ParseFileChoiceField (forms.ModelChoiceField): def label_from_instance (self,obj): return obj.ProcessFile class FrmParser (forms.Form): parsefile = ParseFileChoiceField(queryset=Upload.objects.filter (numrecs__exact=0),empty_label='Choose',required=True,widget=forms.Select ()) The result is this: Choose Upload object I need the visible text to be the ProcessFile value rather than Upload Object any ideas? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---