I have this class

class DocumentMetaData(models.Model):
    document = models.ManyToManyField(Document)
    metadata = models.ManyToManyField(MetaData)
    metadatavalue = models.ManyToManyField(MetaDataValue)

    def __str__(self):
        return "%s - %s" % (self.document, self.metadata)

The Document class has a field called 'title' and the Metadata class has a
field called 'name'. How do I accesses these two fields from the class
DocumentMetaData so the string output is something like <document.title> - <
metadata.name>?

Thanks!

Mark

-- 
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/CAEqej2NCVAp07CvESrUnR7k61UG4b0_q5OcaemfOrh%2B77mnTdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to