As still learning django I have a simple issue.

I have the following models:


class Contactnumber(TimeStampedModel):
    phone_number = models.CharField(max_length=100, unique=True)
    contact = models.ForeignKey(‘contacts.Contact')



class Contact(TimeStampedModel):
    contact = models.CharField(max_length=100, db_index=True,
                               verbose_name='Contact Name')
    practice = models.ManyToManyField(‘practice.Practice’,
                                      related_name=“contacts",)



class Practice(TimeStampedModel):
    practice = models.CharField(max_length=150, db_index=True,
                                verbose_name='Practice Name',
                                help_text="include location for 
multi-branch”)



I have a template including data tables in which I want to show the 
following:
Practice, Contact, Contact Phone 

The following gives me the contact for the practice:    
<td>{% for contact in practice.contacts.all %}
               {{ contact }}
           {% endfor %}</td>

My question is how do  include the contact phone number as I seem a bit 
lost.
Any help would be appreciated. Apologies if this is a simple question!

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/0d8490a2-db29-435a-9477-e26dfa03c560%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to