Thursday, September 17, 2015

Django choice_set feeding from model class objects

Hey everyone!

Say we have a:

class Friends(models.Model):
    person_name = models.CharField(max_length=50)

so this will later on give us instances, like: 'Ben', 'Peter', 'Tom'

class Myself(models.Mode):
    your_name = models.CharField(max_length=50)

and here I wish to add a dropdown/radio ChoiceField which feeds from Friends' names.
How do I do that?

Thank you very much in advance!!!

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8fcf96fc-10e8-412f-9a1f-43f1fc30c03b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment