Hi
I have two models, A and B, with B having an M2M relationship to A.
What is the best way to access/list the 'joined' data in a Django
template? Would it be best to define the potential joint data in the
_str_ as well?
eg. I have the following error appearing, instead of the object:
django.db.models.fields.related.ManyRelatedManager object
Here's the code for the models:
class Organisation(models.Model):
product = models.CharField (maxlength = 100)
def get_absolute_url(self):
return self.org_name
class Category(models.Model):
category = models.ManyToManyField (Organisation)
def get_absolute_url(self):
return self.category
What would I put in the template to return the values of all Categories
selected for each Organisation?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---