In the First Screenshot the code is
def __str__(self):
return "Customer" + "self.id"



Remove the quotes from "self.id"

def __str__(self):
return "Customer" + self.id



On Wed, 12 Dec 2018 at 10:47, <progmgpp...@gmail.com> wrote:

>
> TY madjardi for all your input! I continued to search and found what I
> wanted. But I still need to understand how it all works. I know it is an
> initiation function on the form but not sure how variables are transported
> around to give me the results. But I think I can dig further to find out.
> Here is what works for me:
> class frmCustomerList(forms.Form):
> name = forms.ChoiceField(choices = [])
>
> def __init__(self, *args, **kwargs):
> super(frmCustomerList, self).__init__(*args, **kwargs)
> self.fields['name'].choices = [(x.pk, x.name) for x in
> dbCustomer.objects.all()]
>
>>
>>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1f80363b-47e4-490f-88e5-3c52277ea615%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/1f80363b-47e4-490f-88e5-3c52277ea615%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHfehoXM53KRQhEeviZdZ4O_aa5gNLZ9aceWZtPySiTQO%2BAuNw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to