class Map(Group):
members = models.ManyToManyField(User, related_name='maps', verbose_name=_('members'))
class Position(models.Model):
map = models.ForeignKey(Map)
LatLng = models.CharField(max_length=2000)
and the Group is :
class Group(models.Model):
"""
a group is a group of users with a common interest
"""
slug = models.SlugField(_('slug'), unique=True)
name = models.CharField(_('name'), max_length=80, unique=True)
creator = models.ForeignKey(User, verbose_name=_('creator'), related_name="%(class)s_created")
created = models.DateTimeField(_('created'), default=datetime.datetime.now)
description = models.TextField(_('description'))
and my code is :
map=Map.objects.filter(members__name__exact='www')
print map[0].id
but i can't get the map,
how to do ?
thanks